|
@ -394,7 +394,7 @@ void iguana_bundlespeculate(struct iguana_info *coin,struct iguana_bundle *bp,in |
|
|
|
|
|
|
|
|
int32_t iguana_bundleiters(struct iguana_info *coin,struct iguana_bundle *bp,int32_t timelimit) |
|
|
int32_t iguana_bundleiters(struct iguana_info *coin,struct iguana_bundle *bp,int32_t timelimit) |
|
|
{ |
|
|
{ |
|
|
int32_t i,n,better,issued,valid,pend,max,counter = 0; uint32_t now; struct iguana_block *block; double endmillis,width; |
|
|
int32_t i,n,range,better,issued,valid,pend,max,counter = 0; uint32_t now; struct iguana_block *block; double endmillis,width; |
|
|
coin->numbundlesQ--; |
|
|
coin->numbundlesQ--; |
|
|
//printf("BUNDLEITERS.%d\n",bp->hdrsi);
|
|
|
//printf("BUNDLEITERS.%d\n",bp->hdrsi);
|
|
|
if ( bp->numhashes < bp->n && bp->bundleheight < coin->longestchain-coin->chain->bundlesize ) |
|
|
if ( bp->numhashes < bp->n && bp->bundleheight < coin->longestchain-coin->chain->bundlesize ) |
|
@ -418,7 +418,11 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct iguana_bundle *bp,int |
|
|
iguana_bundleQ(coin,bp,bp->n*5); |
|
|
iguana_bundleQ(coin,bp,bp->n*5); |
|
|
return(0); |
|
|
return(0); |
|
|
} |
|
|
} |
|
|
if ( 1 && coin->current != 0 && bp->rank != 0 && bp->rank <= coin->current->hdrsi + coin->peers.numranked ) |
|
|
if ( (range= coin->peers.numranked) > IGUANA_MAXBUNDLES ) |
|
|
|
|
|
range = IGUANA_MAXBUNDLES; |
|
|
|
|
|
if ( 1 && coin->current != 0 ) |
|
|
|
|
|
{ |
|
|
|
|
|
if ( bp->rank != 0 && bp->rank <= coin->current->hdrsi + range ) |
|
|
{ |
|
|
{ |
|
|
for (i=0; i<bp->n; i++) |
|
|
for (i=0; i<bp->n; i++) |
|
|
{ |
|
|
{ |
|
@ -429,6 +433,7 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct iguana_bundle *bp,int |
|
|
//printf("%d ",i);
|
|
|
//printf("%d ",i);
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
//printf("initial requests for hdrs.%d\n",bp->hdrsi);
|
|
|
//printf("initial requests for hdrs.%d\n",bp->hdrsi);
|
|
|
} |
|
|
} |
|
|
pend = queue_size(&coin->priorityQ) + queue_size(&coin->blocksQ); |
|
|
pend = queue_size(&coin->priorityQ) + queue_size(&coin->blocksQ); |
|
@ -1039,9 +1044,9 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr) |
|
|
} |
|
|
} |
|
|
if ( req == 0 ) |
|
|
if ( req == 0 ) |
|
|
{ |
|
|
{ |
|
|
if ( (rand() % 1) == 0 ) |
|
|
if ( (rand() % 10) == 0 ) |
|
|
flag = iguana_neargap(coin,addr); |
|
|
flag = iguana_neargap(coin,addr); |
|
|
else if ( 1 && (bp= addr->bp) != 0 && bp->rank != 0 && addr->pendblocks < limit ) |
|
|
else if ( 0 && (bp= addr->bp) != 0 && bp->rank != 0 && addr->pendblocks < limit ) |
|
|
{ |
|
|
{ |
|
|
r = rand(); |
|
|
r = rand(); |
|
|
for (j=0; j<bp->n; j++) |
|
|
for (j=0; j<bp->n; j++) |
|
|