Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
eee05b723a
  1. 2
      iguana/iguana_blocks.c
  2. 20
      iguana/iguana_bundles.c
  3. 4
      iguana/iguana_recv.c

2
iguana/iguana_blocks.c

@ -345,7 +345,7 @@ struct iguana_block *_iguana_chainlink(struct iguana_info *coin,struct iguana_bl
if ( bp != 0 && bp->hdrsi == coin->bundlescount-1 ) if ( bp != 0 && bp->hdrsi == coin->bundlescount-1 )
{ {
//printf("created last bundle ht.%d\n",bp->bundleheight); //printf("created last bundle ht.%d\n",bp->bundleheight);
iguana_blockreq(coin,block->height,1); iguana_blockreq(coin,block->height,0);
} }
} }
else else

20
iguana/iguana_bundles.c

@ -513,7 +513,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
flag++; flag++;
counter++; counter++;
block->peerid = 0; block->peerid = 0;
iguana_blockQ("kick",coin,bp,j,block->RO.hash2,bp == coin->current); iguana_blockQ("kick",coin,bp,j,block->RO.hash2,0);
if ( bp == coin->current ) if ( bp == coin->current )
bp->issued[i] = block->issued = now; bp->issued[i] = block->issued = now;
} }
@ -545,7 +545,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
if ( priority != 0 ) if ( priority != 0 )
{ {
//printf("[%d:%d] ",bp->hdrsi,i); //printf("[%d:%d] ",bp->hdrsi,i);
iguana_blockQ("kicka",coin,bp,i,block->RO.hash2,forceflag); iguana_blockQ("kicka",coin,bp,i,block->RO.hash2,0*forceflag);
if ( forceflag != 0 && (addr= coin->peers.ranked[rand() % numpeers]) != 0 ) if ( forceflag != 0 && (addr= coin->peers.ranked[rand() % numpeers]) != 0 )
iguana_sendblockreqPT(coin,addr,bp,i,block->RO.hash2,0); iguana_sendblockreqPT(coin,addr,bp,i,block->RO.hash2,0);
} }
@ -575,7 +575,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
block->numrequests++; block->numrequests++;
if ( bp == coin->current ) if ( bp == coin->current )
printf("[%d:%d].%x ",bp->hdrsi,i,block->fpipbits); printf("[%d:%d].%x ",bp->hdrsi,i,block->fpipbits);
iguana_blockQ("kickc",coin,bp,i,block->RO.hash2,bp == coin->current && now > block->issued+lag); iguana_blockQ("kickc",coin,bp,i,block->RO.hash2,0);//bp == coin->current && now > block->issued+lag);
bp->issued[i] = block->issued = now; bp->issued[i] = block->issued = now;
counter++; counter++;
if ( --max <= 0 ) if ( --max <= 0 )
@ -587,7 +587,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
{ {
if ( bp == coin->current ) if ( bp == coin->current )
printf("[%d:%d].%x ",bp->hdrsi,i,block->fpipbits); printf("[%d:%d].%x ",bp->hdrsi,i,block->fpipbits);
iguana_blockQ("kickd",coin,bp,i,bp->hashes[i],bp == coin->current && now > bp->issued[i]+lag*3); iguana_blockQ("kickd",coin,bp,i,bp->hashes[i],0);//bp == coin->current && now > bp->issued[i]+lag*3);
bp->issued[i] = now; bp->issued[i] = now;
counter++; counter++;
} }
@ -818,7 +818,7 @@ int32_t iguana_bundlefinish(struct iguana_info *coin,struct iguana_bundle *bp)
//#endif //#endif
) )
break; break;
if ( bp->hdrsi < coin->blocks.hwmchain.height/coin->chain->bundlesize && i == bp->hdrsi && coin->emitbusy < (IGUANA_NUMHELPERS/3) ) if ( bp->hdrsi < coin->blocks.hwmchain.height/coin->chain->bundlesize && i == bp->hdrsi && coin->emitbusy <= (IGUANA_NUMHELPERS/3) )
{ {
if ( bp->startutxo == 0 ) if ( bp->startutxo == 0 )
{ {
@ -930,7 +930,7 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct OS_memspace *mem,stru
if ( coin->stucktime != 0 ) if ( coin->stucktime != 0 )
{ {
lag = time(NULL)-coin->stucktime; lag = time(NULL)-coin->stucktime;
if ( ((lag/coin->MAXSTUCKTIME)>>1) > coin->stuckiters || lag > coin->MAXSTUCKTIME ) if ( ((lag/coin->MAXSTUCKTIME)>>1) > coin->stuckiters )//|| lag > coin->MAXSTUCKTIME )
{ {
coin->stuckiters = (int32_t)lag/60; coin->stuckiters = (int32_t)lag/60;
if ( lag > coin->MAXSTUCKTIME ) if ( lag > coin->MAXSTUCKTIME )
@ -949,11 +949,11 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct OS_memspace *mem,stru
} }
if ( (block= bp->blocks[i]) != 0 && (block->RO.recvlen == 0 || block->fpos < 0 || block->fpipbits == 0 || bits256_nonz(block->RO.prev_block) == 0) ) if ( (block= bp->blocks[i]) != 0 && (block->RO.recvlen == 0 || block->fpos < 0 || block->fpipbits == 0 || bits256_nonz(block->RO.prev_block) == 0) )
{ {
if ( time(NULL) > block->issued+10 ) //if ( time(NULL) > block->issued+10 )
{ {
printf("[%d:%d] ",bp->hdrsi,i); printf("[%d:%d] ",bp->hdrsi,i);
iguana_blockQ("stuck",coin,bp,i,block->RO.hash2,0); iguana_blockQ("stuck",coin,bp,i,block->RO.hash2,0);
iguana_blockQ("stuck",coin,bp,i,block->RO.hash2,1); //iguana_blockQ("stuck",coin,bp,i,block->RO.hash2,1);
if ( coin->peers.numranked > 8 && (addr= coin->peers.ranked[n % 8]) != 0 && addr->usock >= 0 && addr->dead == 0 && addr->msgcounts.verack != 0 ) if ( coin->peers.numranked > 8 && (addr= coin->peers.ranked[n % 8]) != 0 && addr->usock >= 0 && addr->dead == 0 && addr->msgcounts.verack != 0 )
{ {
if ( (len= iguana_getdata(coin,serialized,MSG_BLOCK,&block->RO.hash2,1)) > 0 ) if ( (len= iguana_getdata(coin,serialized,MSG_BLOCK,&block->RO.hash2,1)) > 0 )
@ -1066,10 +1066,10 @@ void iguana_bundlestats(struct iguana_info *coin,char *str)
for (j=0; j<bp->n; j++) for (j=0; j<bp->n; j++)
if ( (block= bp->blocks[j]) != 0 && (block->RO.recvlen == 0 || block->fpipbits == 0 || block->fpos < 0) && time(NULL) > block->issued+3 && (rand() % 10) == 0 ) if ( (block= bp->blocks[j]) != 0 && (block->RO.recvlen == 0 || block->fpipbits == 0 || block->fpos < 0) && time(NULL) > block->issued+3 && (rand() % 10) == 0 )
{ {
if ( (r= coin->peers.numranked) != 0 && (addr= coin->peers.ranked[rand() % r]) != 0 && addr->dead == 0 && addr->usock >= 0 ) if ( 0 && (r= coin->peers.numranked) != 0 && (addr= coin->peers.ranked[rand() % r]) != 0 && addr->dead == 0 && addr->usock >= 0 )
iguana_sendblockreqPT(coin,addr,bp,j,block->RO.hash2,0); iguana_sendblockreqPT(coin,addr,bp,j,block->RO.hash2,0);
printf("currentstop [%d:%d]\n",bp->hdrsi,j); printf("currentstop [%d:%d]\n",bp->hdrsi,j);
iguana_blockQ("currentstop",coin,bp,j,block->RO.hash2,1); iguana_blockQ("currentstop",coin,bp,j,block->RO.hash2,0);
block->issued = (uint32_t)time(NULL); block->issued = (uint32_t)time(NULL);
break; break;
} }

4
iguana/iguana_recv.c

@ -780,7 +780,7 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct
iguana_send(coin,addr,serialized,len); iguana_send(coin,addr,serialized,len);
//char str[65]; printf("REQ.%s\n",bits256_str(str,blockhashes[1])); //char str[65]; printf("REQ.%s\n",bits256_str(str,blockhashes[1]));
} }
} else iguana_blockQ("hdr1",coin,0,-1,blockhashes[1],1); } else iguana_blockQ("hdr1",coin,0,-1,blockhashes[1],0);
} }
else else
{ {
@ -788,7 +788,7 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct
{ {
iguana_blockhashset(coin,-1,blockhashes[1],1); iguana_blockhashset(coin,-1,blockhashes[1],1);
if ( (block= iguana_blockfind(coin,blockhashes[1])) != 0 ) if ( (block= iguana_blockfind(coin,blockhashes[1])) != 0 )
iguana_blockQ("recvhash6",coin,0,-6,blockhashes[1],1); // should be RT block iguana_blockQ("recvhash6",coin,0,-6,blockhashes[1],0); // should be RT block
} }
block->newtx = 1; block->newtx = 1;
iguana_blockQ("recvhash6",coin,0,-7,blockhashes[1],0); // should be RT block iguana_blockQ("recvhash6",coin,0,-7,blockhashes[1],0); // should be RT block

Loading…
Cancel
Save