Skip to content

Commit e639364

Browse files
committed
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.
1 parent 1ecdf6e commit e639364

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/validation.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2914,6 +2914,7 @@ CBlockIndex* Chainstate::FindMostWorkChain()
29142914
while (pindexTest != pindexFailed) {
29152915
if (fFailedChain) {
29162916
pindexFailed->nStatus |= BLOCK_FAILED_CHILD;
2917+
m_blockman.m_dirty_blockindex.insert(pindexFailed);
29172918
} else if (fMissingData) {
29182919
// If we're missing data, then add back to m_blocks_unlinked,
29192920
// so that if the block arrives in the future we can try adding

0 commit comments

Comments
 (0)