mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-13 08:58:52 +00:00
index: coinstats reorg, fail when block cannot be reversed
During a reorg, continuing execution when a block cannot be reversed leaves the coinstats index in an inconsistent state, which was surely overlooked when 'CustomRewind' was implemented.
This commit is contained in:
parent
8e0d9796da
commit
eef595560e
@ -288,7 +288,9 @@ bool CoinStatsIndex::CustomRewind(const interfaces::BlockKey& current_tip, const
|
||||
__func__, iter_tip->GetBlockHash().ToString());
|
||||
}
|
||||
|
||||
ReverseBlock(block, iter_tip);
|
||||
if (!ReverseBlock(block, iter_tip)) {
|
||||
return false; // failure cause logged internally
|
||||
}
|
||||
|
||||
iter_tip = iter_tip->GetAncestor(iter_tip->nHeight - 1);
|
||||
} while (new_tip_index != iter_tip);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user