|
|
@ -190,7 +190,7 @@ void iguana_gotblockM(struct iguana_info *coin,struct iguana_peer *addr,struct i |
|
|
|
printf("got block that doesnt validate? %s\n",bits256_str(str,origtxdata->block.RO.hash2)); |
|
|
|
return; |
|
|
|
} //else printf("validated prev.%s\n",bits256_str(str,origtxdata->block.RO.prev_block));
|
|
|
|
copyflag = 0 * (strcmp(coin->symbol,"BTC") != 0); |
|
|
|
copyflag = 1 * (strcmp(coin->symbol,"BTC") != 0); |
|
|
|
bp = 0, bundlei = -2; |
|
|
|
if ( copyflag != 0 && recvlen != 0 && ((bp= iguana_bundlefind(coin,&bp,&bundlei,origtxdata->block.RO.hash2)) == 0 || (bp->blocks[bundlei] != 0 && bp->blocks[bundlei]->fpipbits == 0)) ) |
|
|
|
{ |
|
|
@ -634,12 +634,12 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
printf("no match to allhashes issue block1\n"); |
|
|
|
//printf("no match to allhashes issue block1\n");
|
|
|
|
struct iguana_block *block; |
|
|
|
if ( num == coin->chain->bundlesize+1 && (block= iguana_blockhashset(coin,-1,blockhashes[1],1)) != 0 ) |
|
|
|
{ |
|
|
|
block->blockhashes = blockhashes, req->hashes = 0; |
|
|
|
printf("set block->blockhashes[%d]\n",num); |
|
|
|
//printf("set block->blockhashes[%d]\n",num);
|
|
|
|
} |
|
|
|
if ( (addr= coin->peers.ranked[0]) != 0 ) |
|
|
|
{ |
|
|
@ -972,13 +972,13 @@ int32_t iguana_reqhdrs(struct iguana_info *coin) |
|
|
|
int32_t i,lag,n = 0; struct iguana_bundle *bp; char hashstr[65]; |
|
|
|
if ( queue_size(&coin->hdrsQ) == 0 ) |
|
|
|
{ |
|
|
|
//if ( iguana_needhdrs(coin) > 0 )
|
|
|
|
if ( iguana_needhdrs(coin) > 0 ) |
|
|
|
{ |
|
|
|
for (i=0; i<coin->bundlescount; i++) |
|
|
|
{ |
|
|
|
if ( (bp= coin->bundles[i]) != 0 && (bp->numhashes < bp->n || i == coin->bundlescount-1) ) |
|
|
|
{ |
|
|
|
lag = 30; |
|
|
|
lag = 60; |
|
|
|
if ( bp->bundleheight+bp->numhashes < coin->longestchain && time(NULL) > bp->issuetime+lag ) |
|
|
|
{ |
|
|
|
//printf("LAG.%ld hdrsi.%d numhashes.%d:%d needhdrs.%d qsize.%d zcount.%d\n",time(NULL)-bp->hdrtime,i,bp->numhashes,bp->n,iguana_needhdrs(coin),queue_size(&coin->hdrsQ),coin->zcount);
|
|
|
@ -1097,7 +1097,7 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr) |
|
|
|
} |
|
|
|
if ( bp == 0 || z != 0 ) |
|
|
|
{ |
|
|
|
printf("%s request HDR.(%s) numhashes.%d\n",addr!=0?addr->ipaddr:"local",hashstr,bp!=0?bp->numhashes:0); |
|
|
|
//printf("%s request HDR.(%s) numhashes.%d\n",addr!=0?addr->ipaddr:"local",hashstr,bp!=0?bp->numhashes:0);
|
|
|
|
iguana_send(coin,addr,serialized,datalen); |
|
|
|
addr->pendhdrs++; |
|
|
|
flag++; |
|
|
|