From f5198cf02c1538c1753eed38f6adca663256a4be Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 6 Mar 2016 23:39:52 -0300 Subject: [PATCH] test --- iguana/iguana_bundles.c | 12 +++++++++--- iguana/iguana_recv.c | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 3367b86c5..f18c35659 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -374,11 +374,11 @@ int64_t iguana_bundlecalcs(struct iguana_info *coin,struct iguana_bundle *bp) bp->datasize = bp->numhashes = bp->numsaved = bp->numcached = bp->numrecv = bp->minrequests = 0; for (bundlei=0; bundlein; bundlei++) { - if ( bits256_nonz(bp->hashes[bundlei]) > 0 ) + if ( bits256_nonz(bp->hashes[bundlei]) > 0 && (block= bp->blocks[bundlei]) != 0 ) { - if ( (block= bp->blocks[bundlei]) != 0 || (block= iguana_blockfind(coin,bp->hashes[bundlei])) != 0 ) + if ( block == iguana_blockfind(coin,bp->hashes[bundlei]) ) { - bp->blocks[bundlei] = block; + //bp->blocks[bundlei] = block; if ( bp->minrequests == 0 || (block->numrequests > 0 && block->numrequests < bp->minrequests) ) bp->minrequests = block->numrequests; if ( block->fpipbits != 0 ) @@ -391,6 +391,12 @@ int64_t iguana_bundlecalcs(struct iguana_info *coin,struct iguana_bundle *bp) bp->numcached++; } } + else + { + bp->blocks[bundlei] = iguana_blockfind(coin,bp->hashes[bundlei]); + if ( (block= bp->blocks[bundlei]) != 0 ) + block->fpipbits = block->queued = 0; + } bp->numhashes++; } } diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 49c6bfbfb..e67602c32 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -139,7 +139,7 @@ void iguana_gotblockM(struct iguana_info *coin,struct iguana_peer *addr,struct i } } } - copyflag = 0 * (strcmp(coin->symbol,"BTC") != 0); + copyflag = 1 * (strcmp(coin->symbol,"BTC") != 0); req = iguana_bundlereq(coin,addr,'B',copyflag * recvlen); req->recvlen = recvlen; req->H = *H;