diff --git a/iguana/iguana777.c b/iguana/iguana777.c index d38be0020..6a81a657b 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -416,6 +416,12 @@ int32_t iguana_helperB(struct iguana_info *coin,int32_t helperid,struct iguana_b void iguana_update_balances(struct iguana_info *coin) { int32_t i,hdrsi,max; struct iguana_bundle *bp; char fname[1024]; + if ( coin->RTheight > 0 ) + { + printf("Need to restart iguana to generate new balances files\n"); + printf("RT dataset can expand past bundle boundary, so no need to update balance files now\n"); + return; + } max = coin->bundlescount; if ( coin->bundles[max-1] != 0 && coin->bundles[max-1]->emitfinish <= 1 && coin->RTheight == 0 ) max--; diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index c5dba3c7c..7a24e2d5f 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -218,20 +218,20 @@ int32_t iguana_bundlehash2add(struct iguana_info *coin,struct iguana_block **blo } else { - printf("bp.[%d]->blocks[%d] mismatch %p != %p\n",bp->hdrsi,bundlei,bp->blocks[bundlei],block); if ( coin->RTheight > 0 && bp->bundleheight+bundlei > coin->firstRTheight ) { - if ( bundlei > 0 ) - bundlei--; - if ( (block= iguana_blockfind("reset",coin,bp->hashes[0])) != 0 ) + if ( bundlei > 1 ) + bundlei -= 2; + if ( bp->bundleheight+bundlei > coin->blocks.hwmchain.height && (block= iguana_blockfind("reset",coin,bp->hashes[0])) != 0 ) { iguana_blockzcopy(coin->chain->zcash,(void *)&coin->blocks.hwmchain,block); printf("RESET HWM to %d ht.%d\n",bp->bundleheight+bundlei,block->height); return(-1); - } else printf("couldnt find block at %d\n",bp->bundleheight+bundlei); + } //else printf("couldnt find block at %d\n",bp->bundleheight+bundlei); } else if ( bundlei > 0 ) { + printf("bp.[%d]->blocks[%d] mismatch %p != %p\n",bp->hdrsi,bundlei,bp->blocks[bundlei],block); bp->blocks[bundlei] = 0; } iguana_blockunmark(coin,block,bp,bundlei,1);