0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-03 09:56:38 -05:00

validation: add missing insert to m_dirty_blockindex

...in FindMostWorkChain(). Before this, it was possible that the change
to the block index wouldn't be persisted to disk.
This commit is contained in:
Martin Zumsande 2023-06-16 15:47:45 -04:00
parent 1ecdf6ea8f
commit e639364495

View file

@ -2914,6 +2914,7 @@ CBlockIndex* Chainstate::FindMostWorkChain()
while (pindexTest != pindexFailed) {
if (fFailedChain) {
pindexFailed->nStatus |= BLOCK_FAILED_CHILD;
m_blockman.m_dirty_blockindex.insert(pindexFailed);
} else if (fMissingData) {
// If we're missing data, then add back to m_blocks_unlinked,
// so that if the block arrives in the future we can try adding