From a376ee14afd9ca121884bbdbbcda70dfae306200 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 8 Apr 2016 19:05:21 -0500 Subject: [PATCH] test --- iguana/iguana_blocks.c | 6 ++++-- iguana/iguana_unspents.c | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/iguana_blocks.c b/iguana/iguana_blocks.c index 3f0306389..e296f882f 100755 --- a/iguana/iguana_blocks.c +++ b/iguana/iguana_blocks.c @@ -352,11 +352,13 @@ struct iguana_block *iguana_fastlink(struct iguana_info *coin,int32_t hwmheight) printf("iguana_fastlink null bundle.[%d]\n",hdrsi); break; } - if ( (block= bp->blocks[bundlei]) == 0 ) + block = iguana_blockhashset("fastlink",coin,height,bp->hashes[bundlei],1); + if ( bp->blocks[bundlei] != 0 && block != bp->blocks[bundlei] ) { printf("iguana_fastlink null block.[%d:%d]\n",hdrsi,bundlei); break; } + bp->blocks[bundlei] = block; coin->blocks.maxblocks = (block->height + 1); if ( coin->blocks.maxblocks > coin->longestchain ) coin->longestchain = coin->blocks.maxblocks; @@ -368,11 +370,11 @@ struct iguana_block *iguana_fastlink(struct iguana_info *coin,int32_t hwmheight) block->hh.prev = prev; if ( prev != 0 ) prev->hh.next = block; + iguana_bundlehash2add(coin,0,bp,bundlei,block->RO.hash2); prev = block; prevPoW = block->PoW; } iguana_walkchain(coin,0); - iguana_walkchain(coin,1); return(block); } diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 65f5705ee..960acfa46 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -1308,8 +1308,6 @@ int32_t iguana_volatilesinit(struct iguana_info *coin) coin->blocks.hwmchain = *iguana_blockfind("init",coin,coin->bundles[coin->balanceswritten-1]->hashes[bp->n-1]); if ( (n= iguana_walkchain(coin,0)) > 0 ) printf("iguana_walkchain n.%d vs hwmheight.%d\n",n,coin->blocks.hwmchain.height); - if ( (n= iguana_walkchain(coin,0)) > 0 ) - printf("iguana_walkchainB n.%d vs hwmheight.%d\n",n,coin->blocks.hwmchain.height); //iguana_fastlink(coin,coin->balanceswritten * coin->chain->bundlesize - 1); return(coin->balanceswritten); }