|
@ -392,12 +392,20 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int |
|
|
if ( block->peerid == 0 ) |
|
|
if ( block->peerid == 0 ) |
|
|
{ |
|
|
{ |
|
|
//printf("<%d> ",i);
|
|
|
//printf("<%d> ",i);
|
|
|
|
|
|
if ( block->fpipbits != 0 ) |
|
|
|
|
|
{ |
|
|
hashes[k++] = bp->hashes[i]; |
|
|
hashes[k++] = bp->hashes[i]; |
|
|
block->issued = now; |
|
|
block->issued = now; |
|
|
block->peerid = j + 1; |
|
|
block->peerid = j + 1; |
|
|
block->numrequests++; |
|
|
block->numrequests++; |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
block->peerid = 1; |
|
|
|
|
|
block->numrequests++; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
{ |
|
|
{ |
|
|
if ( block->fpipbits == 0 ) |
|
|
if ( block->fpipbits == 0 ) |
|
|
{ |
|
|
{ |
|
@ -405,7 +413,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int |
|
|
if ( peercounts[block->peerid - 1] > maxval ) |
|
|
if ( peercounts[block->peerid - 1] > maxval ) |
|
|
maxval = peercounts[block->peerid - 1]; |
|
|
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]++; |
|
|
donecounts[block->peerid - 1]++; |
|
|
if ( donecounts[block->peerid - 1] > minval ) |
|
|
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; i<bp->n; i+=numpeers) |
|
|
for (i=j; i<bp->n; i+=numpeers) |
|
|
if ( (block= bp->blocks[i]) != 0 && (oldest == 0 || block->issued < oldest->issued) ) |
|
|
if ( (block= bp->blocks[i]) != 0 && (oldest == 0 || block->issued < oldest->issued) ) |
|
|
{ |
|
|
{ |
|
|
if ( now > block->issued+10 ) |
|
|
if ( now > block->issued+1 ) |
|
|
oldest = block; |
|
|
oldest = block; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -467,7 +475,9 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
/*if ( bp->numsaved < bp->n*.95 )
|
|
|
if ( bp == coin->current ) |
|
|
|
|
|
{ |
|
|
|
|
|
if ( bp->numsaved < bp->n*.95 ) |
|
|
{ |
|
|
{ |
|
|
for (i=0; i<numpeers; i++) |
|
|
for (i=0; i<numpeers; i++) |
|
|
printf("%d ",peercounts[i]); |
|
|
printf("%d ",peercounts[i]); |
|
@ -478,7 +488,8 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int |
|
|
if ( (block= bp->blocks[i]) != 0 && block->fpipbits == 0 ) |
|
|
if ( (block= bp->blocks[i]) != 0 && block->fpipbits == 0 ) |
|
|
printf("[%d:%d] ",bp->hdrsi,i); |
|
|
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); |
|
|
return(counter); |
|
|
} |
|
|
} |
|
|
/*if ( 0 && time(NULL) > bp->lastspeculative+60 )
|
|
|
/*if ( 0 && time(NULL) > bp->lastspeculative+60 )
|
|
|