mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-06 11:13:02 +02: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:
@@ -288,7 +288,9 @@ bool CoinStatsIndex::CustomRewind(const interfaces::BlockKey& current_tip, const
|
|||||||
__func__, iter_tip->GetBlockHash().ToString());
|
__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);
|
iter_tip = iter_tip->GetAncestor(iter_tip->nHeight - 1);
|
||||||
} while (new_tip_index != iter_tip);
|
} while (new_tip_index != iter_tip);
|
||||||
|
|||||||
Reference in New Issue
Block a user