From 3f4e7fa2d1f8664ca5d888d30d19f6e03010b98d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 29 Mar 2016 03:23:45 -0300 Subject: [PATCH] test --- iguana/iguana_bundles.c | 5 ++++- iguana/iguana_recv.c | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index a630285c4..62cd8d318 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -1123,7 +1123,10 @@ void iguana_bundlestats(struct iguana_info *coin,char *str) missing++; if ( bp->speculativecache[j] != 0 ) { - if ( bp->speculativecache[j] != 0 && (block= iguana_blockfind(coin,bp->speculative[j])) != 0 ) + block = iguana_blockfind(coin,bp->speculative[j]); + if ( block != 0 ) + block->queued = 1; + if ( bp->speculativecache[j] != 0 && block != 0 ) { block->bundlei = j; block->hdrsi = bp->hdrsi; diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 9b8ed63f7..4be0267ea 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -55,7 +55,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr, coin->numreqsent++; addr->pendblocks++; addr->pendtime = (uint32_t)time(NULL); - //if ( 0 && coin->current == bp ) + if ( 0 && coin->current == bp ) printf("REQ.%s bundlei.%d hdrsi.%d\n",bits256_str(hexstr,hash2),bundlei,bp!=0?bp->hdrsi:-1); } else printf("MSG_BLOCK null datalen.%d\n",len); return(len); @@ -1284,6 +1284,8 @@ int32_t iguana_blockQ(char *argstr,struct iguana_info *coin,struct iguana_bundle } return(0); } + if ( block->queued != 0 ) + return(0); height = block->height; } if ( bp != 0 && bp->emitfinish != 0 ) @@ -1303,7 +1305,7 @@ int32_t iguana_blockQ(char *argstr,struct iguana_info *coin,struct iguana_bundle req->height = height; req->bundlei = bundlei; char str2[65]; - printf("%s %s %s [%d:%d] %d %s %d numranked.%d qsize.%d\n",coin->symbol,argstr,str,bp!=0?bp->hdrsi:-1,bundlei,req->height,bits256_str(str2,hash2),coin->blocks.recvblocks,coin->peers.numranked,queue_size(Q)); + //printf("%s %s %s [%d:%d] %d %s %d numranked.%d qsize.%d\n",coin->symbol,argstr,str,bp!=0?bp->hdrsi:-1,bundlei,req->height,bits256_str(str2,hash2),coin->blocks.recvblocks,coin->peers.numranked,queue_size(Q)); if ( Q == &coin->blocksQ ) { if ( (n= queue_size(Q)) > 100000 )