From eee05b723a6165da079d00566fda3fbe5bbcc8bd Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 28 Mar 2016 16:29:19 -0300 Subject: [PATCH] test --- iguana/iguana_blocks.c | 2 +- iguana/iguana_bundles.c | 20 ++++++++++---------- iguana/iguana_recv.c | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/iguana/iguana_blocks.c b/iguana/iguana_blocks.c index 117a08b4b..d872dd168 100755 --- a/iguana/iguana_blocks.c +++ b/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 ) { //printf("created last bundle ht.%d\n",bp->bundleheight); - iguana_blockreq(coin,block->height,1); + iguana_blockreq(coin,block->height,0); } } else diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 29776b710..32b89f3ed 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -513,7 +513,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int flag++; counter++; 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 ) 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 ) { //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 ) 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++; if ( bp == coin->current ) 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; counter++; if ( --max <= 0 ) @@ -587,7 +587,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int { if ( bp == coin->current ) 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; counter++; } @@ -818,7 +818,7 @@ int32_t iguana_bundlefinish(struct iguana_info *coin,struct iguana_bundle *bp) //#endif ) 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 ) { @@ -930,7 +930,7 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct OS_memspace *mem,stru if ( coin->stucktime != 0 ) { 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; 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 ( time(NULL) > block->issued+10 ) + //if ( time(NULL) > block->issued+10 ) { 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,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 ( (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; jn; 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 ( (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); 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); break; } diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 4cf86295d..13232a7fb 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -780,7 +780,7 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct iguana_send(coin,addr,serialized,len); //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 { @@ -788,7 +788,7 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct { iguana_blockhashset(coin,-1,blockhashes[1],1); 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; iguana_blockQ("recvhash6",coin,0,-7,blockhashes[1],0); // should be RT block