From 498f108f4dc94c86a163c72b725dc98fe2cc1f36 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Jan 2016 22:02:54 -0300 Subject: [PATCH] test --- iguana/iguana_bundles.c | 2 +- iguana/iguana_peers.c | 4 ++-- iguana/iguana_recv.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index b3ff08520..b5af971f8 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -535,7 +535,7 @@ void iguana_bundlestats(struct iguana_info *coin,char *str) } /*for (i=0; irankedbps[i][0],coin->rankedbps[i][1],coin->bundles[(int32_t)coin->rankedbps[i][1]]->numrecv);*/ - if ( 1 && flag != 0 ) + if ( 0 && flag != 0 ) printf("rem.%d issue.%d pend.%d | numranked.%d\n",n,origissue,pend,coin->peers.numranked); } } diff --git a/iguana/iguana_peers.c b/iguana/iguana_peers.c index ca5b0af58..8c25fab40 100755 --- a/iguana/iguana_peers.c +++ b/iguana/iguana_peers.c @@ -996,11 +996,11 @@ void iguana_dedicatedloop(struct iguana_info *coin,struct iguana_peer *addr) { if ( run++ > 1000 ) { - //printf("sleep\n"); + printf("sleep\n"); sleep(1); } else if ( addr->rank != 1 ) - usleep(coin->polltimeout*2500 + (rand() % (coin->polltimeout*2500))); + usleep(coin->polltimeout*250 + (rand() % (coin->polltimeout*250))); else usleep(100 + coin->polltimeout*1000); } //else printf("flag.%d\n",flag); } diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 4022eb880..061b54237 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -310,7 +310,7 @@ int32_t iguana_allhashcmp(struct iguana_info *coin,struct iguana_bundle *bp,bits { if ( (err= iguana_bundlehash2add(coin,0,bp,i,blockhashes[i])) < 0 ) return(err); - if ( 1 && bp->emitfinish == 0 && (block= bp->blocks[i]) != 0 && (block->queued == 0 && block->fpipbits == 0) && block->numrequests == 0 ) + if ( 1 && bp->emitfinish == 0 && (block= bp->blocks[i]) != 0 && (block->queued == 0 && block->fpipbits == 0) && block->numrequests <= bp->minrequests+10 ) iguana_blockQ(coin,bp,i,block->RO.hash2,0), n++; } printf("ALLHASHES FOUND! %d requested.%d\n",bp->bundleheight,n); @@ -427,7 +427,7 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct n++; } } - printf("got [%d] num.%d matched hashes\n",n,num); + //printf("got [%d] num.%d matched hashes\n",n,num); } else { @@ -465,7 +465,7 @@ struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana struct iguana_bundle *prevbp=0,*bp=0; int32_t prevbundlei=-2,bundlei = -2; struct iguana_block *prevblock,*block; bp = iguana_bundleset(coin,&block,&bundlei,origblock); //usleep(1000); - //static int total; char str[65]; printf("RECV %s [%d:%d] block.%08x | %d\n",bits256_str(str,origblock->RO.hash2),bp!=0?bp->hdrsi:-1,bundlei,block->fpipbits,total++); + static int total; char str[65]; printf("RECV %s [%d:%d] block.%08x | %d\n",bits256_str(str,origblock->RO.hash2),bp!=0?bp->hdrsi:-1,bundlei,block->fpipbits,total++); iguana_bundlefind(coin,&prevbp,&prevbundlei,origblock->RO.prev_block); if ( prevbp != 0 && prevbundlei >= 0 && (prevblock= iguana_blockfind(coin,origblock->RO.prev_block)) != 0 ) {