|
|
@ -314,7 +314,7 @@ void iguana_gotblockM(struct iguana_info *coin,struct iguana_peer *addr,struct i |
|
|
|
uint64_t sum2 = 0,sum = 0; |
|
|
|
for (i=0; i<sizeof(received)/sizeof(*received); i++) |
|
|
|
sum += received[i], sum2 += count[i]; |
|
|
|
//char str[65],str2[65],str3[65]; printf("TOTAL BLOCKS.%llu RECEIVED %s ave %.1f | duplicates.%d %s afteremit.%d %s\n",(long long)sum2,mbstr(str,sum),(double)sum/(sum2!=0?sum2:1),numDuplicates,mbstr(str2,sizeDuplicates),numAfteremit,mbstr(str3,sizeAfteremit));
|
|
|
|
char str[65],str2[65],str3[65]; printf("TOTAL BLOCKS.%llu RECEIVED %s ave %.1f | duplicates.%d %s afteremit.%d %s\n",(long long)sum2,mbstr(str,sum),(double)sum/(sum2!=0?sum2:1),numDuplicates,mbstr(str2,sizeDuplicates),numAfteremit,mbstr(str3,sizeAfteremit)); |
|
|
|
} |
|
|
|
} |
|
|
|
copyflag = 0;//(coin->enableCACHE != 0) && (strcmp(coin->symbol,"BTC") != 0);
|
|
|
@ -328,7 +328,7 @@ void iguana_gotblockM(struct iguana_info *coin,struct iguana_peer *addr,struct i |
|
|
|
sizeAfteremit += recvlen; |
|
|
|
if ( (block= bp->blocks[bundlei]) != 0 ) |
|
|
|
iguana_bundletime(coin,bp,bundlei,block,1); |
|
|
|
//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++; |
|
|
@ -339,13 +339,14 @@ void iguana_gotblockM(struct iguana_info *coin,struct iguana_peer *addr,struct i |
|
|
|
numDuplicates++; |
|
|
|
sizeDuplicates += recvlen; |
|
|
|
iguana_bundletime(coin,bp,bundlei,block,1); |
|
|
|
//printf("duplicate [%d:%d] %s\n",bp->hdrsi,bundlei,bits256_str(str,block->RO.hash2));
|
|
|
|
printf("duplicate [%d:%d] %s\n",bp->hdrsi,bundlei,bits256_str(str,block->RO.hash2)); |
|
|
|
if ( bits256_cmp(origtxdata->block.RO.hash2,block->RO.hash2) == 0 ) |
|
|
|
return; |
|
|
|
else printf("mismatched tx received? mainchain.%d\n",block->mainchain); |
|
|
|
if ( block->mainchain != 0 ) |
|
|
|
return; |
|
|
|
} //else printf("recv [%d:%d] %s\n",bp->hdrsi,bundlei,bits256_str(str,block->RO.hash2));
|
|
|
|
} else if ( bp == coin->current ) |
|
|
|
printf("recv [%d:%d] %s\n",bp->hdrsi,bundlei,bits256_str(str,block->RO.hash2)); |
|
|
|
iguana_bundletime(coin,bp,bundlei,block,0); |
|
|
|
block->RO = origtxdata->block.RO; |
|
|
|
block->txvalid = 1; |
|
|
@ -934,13 +935,20 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct |
|
|
|
|
|
|
|
struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana_peer *addr,struct iguana_bundlereq *req,struct iguana_block *origblock,int32_t numtx,int32_t datalen,int32_t recvlen,int32_t *newhwmp) |
|
|
|
{ |
|
|
|
struct iguana_bundle *bp=0,*prev; int32_t numsaved=0,bundlei = -2; struct iguana_block *block,*tmpblock; char str[65]; |
|
|
|
struct iguana_bundle *bp=0,*prev; int32_t numsaved=0,bundlei = -2; struct iguana_block *block,*tmpblock; char str[65]; bits256 hash2; |
|
|
|
if ( (bp= iguana_bundleset(coin,&block,&bundlei,origblock)) != 0 && bp == coin->current && block != 0 && bp->speculative != 0 && bundlei >= 0 ) |
|
|
|
{ |
|
|
|
if ( bp->speculative != 0 && bp->numspec <= bundlei ) |
|
|
|
{ |
|
|
|
bp->speculative[bundlei] = block->RO.hash2; |
|
|
|
bp->numspec = bundlei+1; |
|
|
|
while ( bundlei < bp->n && block != 0 && bp->bundleheight+bundlei == coin->blocks.hwmchain.height+1 && _iguana_chainlink(coin,block) != 0 ) |
|
|
|
{ |
|
|
|
printf("MAIN.%d ",bp->bundleheight+bundlei); |
|
|
|
bundlei++; |
|
|
|
block = iguana_bundleblock(coin,&hash2,bp,bundlei); |
|
|
|
} |
|
|
|
printf("autoadd [%d:%d]\n",bp->hdrsi,bundlei); |
|
|
|
} |
|
|
|
} |
|
|
|
if ( bp != 0 ) |
|
|
@ -950,7 +958,7 @@ struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana |
|
|
|
{ |
|
|
|
if ( (prev= coin->bundles[bp->hdrsi - 1]) != 0 ) |
|
|
|
{ |
|
|
|
printf("found adjacent [%d:%d] speculative.%p\n",prev->hdrsi,bp->n-1,prev->speculative); |
|
|
|
//printf("found adjacent [%d:%d] speculative.%p\n",prev->hdrsi,bp->n-1,prev->speculative);
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|