From ee33885aca07564b922b3cc95948c0aa78591593 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 18 Mar 2016 00:13:12 -0300 Subject: [PATCH] test --- iguana/iguana_bundles.c | 43 ++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index a6bc9ded5..64cb24c01 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -392,10 +392,18 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int if ( block->peerid == 0 ) { //printf("<%d> ",i); - hashes[k++] = bp->hashes[i]; - block->issued = now; - block->peerid = j + 1; - block->numrequests++; + if ( block->fpipbits != 0 ) + { + hashes[k++] = bp->hashes[i]; + block->issued = now; + block->peerid = j + 1; + block->numrequests++; + } + else + { + block->peerid = 1; + block->numrequests++; + } } else { @@ -405,7 +413,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int if ( peercounts[block->peerid - 1] > maxval ) maxval = peercounts[block->peerid - 1]; } - else if ( block->fpipbits != 0 && block->fpos >= 0 ) + else if ( block->fpipbits != 0 )//&& block->fpos >= 0 ) { donecounts[block->peerid - 1]++; if ( donecounts[block->peerid - 1] > minval ) @@ -444,7 +452,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int for (i=j; in; i+=numpeers) if ( (block= bp->blocks[i]) != 0 && (oldest == 0 || block->issued < oldest->issued) ) { - if ( now > block->issued+10 ) + if ( now > block->issued+1 ) oldest = block; } } @@ -467,18 +475,21 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int } } } - /*if ( bp->numsaved < bp->n*.95 ) - { - for (i=0; icurrent ) { - for (i=0; in; i++) - if ( (block= bp->blocks[i]) != 0 && block->fpipbits == 0 ) - printf("[%d:%d] ",bp->hdrsi,i); + if ( bp->numsaved < bp->n*.95 ) + { + for (i=0; in; i++) + if ( (block= bp->blocks[i]) != 0 && block->fpipbits == 0 ) + printf("[%d:%d] ",bp->hdrsi,i); + } + printf("currentflag.%d %d\n",bp->currentflag,bp->bundleheight); } - printf("currentflag.%d %d\n",bp->currentflag,bp->bundleheight);*/ return(counter); } /*if ( 0 && time(NULL) > bp->lastspeculative+60 )