From c6b2decabf01d86e1ceaab3abda626e7b06af1a2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 29 Mar 2016 04:29:39 -0300 Subject: [PATCH] test --- iguana/iguana_bundles.c | 8 ++++---- iguana/iguana_recv.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 5031bbe92..e046db7df 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -587,7 +587,6 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int if ( bp == coin->current ) return(counter); } - return(counter); for (i=0; in; i++) { if ( (block= bp->blocks[i]) != 0 && bp->speculativecache[i] == 0 ) @@ -663,7 +662,7 @@ int32_t iguana_bundlehdr(struct iguana_info *coin,struct iguana_bundle *bp,int32 { int32_t counter=0; int32_t i; uint32_t now; struct iguana_block *block; - if ( bp->isRT == 0 && (bp->hdrsi == coin->bundlescount-1 || bp == coin->current) ) + if ( 0 && bp->isRT == 0 && (bp->hdrsi == coin->bundlescount-1 || bp == coin->current) ) printf("hdr ITERATE.%d bundle.%d vs %d: h.%d n.%d r.%d s.%d c.%d finished.%d spec.%p[%d]\n",bp->hdrsi,bp->bundleheight,coin->longestchain-coin->chain->bundlesize,bp->numhashes,bp->n,bp->numrecv,bp->numsaved,bp->numcached,bp->emitfinish,bp->speculative,bp->numspec); if ( coin->enableCACHE != 0 && bp->numhashes < bp->n && (bp->speculative == 0 || bp->hdrsi >= coin->longestchain/bp->n) ) { @@ -1150,7 +1149,7 @@ void iguana_bundlestats(struct iguana_info *coin,char *str) } continue; } - if ( now > bp->issued[j]+3 || (rand() % 10) == 0 ) + if ( bp == coin->current && (now > bp->issued[j]+3 || (rand() % 10) == 0) ) { //fprintf(stderr,"-[%d:%d].%d ",bp->hdrsi,j,now-bp->issued[j]); struct iguana_peer *addr; int32_t r; @@ -1161,7 +1160,8 @@ void iguana_bundlestats(struct iguana_info *coin,char *str) bp->issued[j] = now; } } - fprintf(stderr,"[%d] check numcached.%d numhashes.%d numsaved.%d havefile.%d missing.%d\n",bp->hdrsi,bp->numcached,bp->numhashes,bp->numsaved,havefile,missing); + if ( bp == coin->current ) + fprintf(stderr,"[%d] check numcached.%d numhashes.%d numsaved.%d havefile.%d missing.%d\n",bp->hdrsi,bp->numcached,bp->numhashes,bp->numsaved,havefile,missing); } if ( bp->speculative != 0 && missing == 0 ) { diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 511fbf664..b357ff5f1 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -257,7 +257,7 @@ void iguana_gotblockM(struct iguana_info *coin,struct iguana_peer *addr,struct i { if ( bp->emitfinish != 0 ) { - printf("got [%d:%d] with emitfinish.%u\n",bp->hdrsi,bundlei,bp->emitfinish); + //printf("got [%d:%d] with emitfinish.%u\n",bp->hdrsi,bundlei,bp->emitfinish); return; } bp->dirty++; @@ -702,7 +702,7 @@ struct iguana_bundlereq *iguana_recvblockhdrs(struct iguana_info *coin,struct ig void iguana_autoextend(struct iguana_info *coin,struct iguana_bundle *bp) { - char hashstr[65],str[65],str2[65]; struct iguana_bundle *newbp; int32_t bundlei; static bits256 zero; + char hashstr[65]; struct iguana_bundle *newbp; int32_t bundlei; static bits256 zero; if ( bp->hdrsi == coin->bundlescount-1 && bits256_nonz(bp->nextbundlehash2) != 0 ) { init_hexbytes_noT(hashstr,bp->nextbundlehash2.bytes,sizeof(bits256)); @@ -711,7 +711,7 @@ void iguana_autoextend(struct iguana_info *coin,struct iguana_bundle *bp) { if ( newbp->speculative == 0 ) queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(hashstr),1); - printf("EXTEND last bundle %s/%s ht.%d\n",bits256_str(str,newbp->hashes[0]),bits256_str(str2,bp->nextbundlehash2),newbp->bundleheight); + //printf("EXTEND last bundle %s/%s ht.%d\n",bits256_str(str,newbp->hashes[0]),bits256_str(str2,bp->nextbundlehash2),newbp->bundleheight); if ( newbp->queued == 0 ) iguana_bundleQ(coin,newbp,1000); }