mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-04 13:55:23 -05: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
1 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue