Skip to content

Commit

Permalink
validation: add missing insert to m_dirty_blockindex
Browse files Browse the repository at this point in the history
...in FindMostWorkChain(). Before this, it was possible that the change
to the block index wouldn't be persisted to disk.
  • Loading branch information
mzumsande committed Jun 16, 2023
1 parent 1ecdf6e commit e639364
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e639364

Please sign in to comment.