From e639364495a26bd67dd08998fc7ec400747f9a15 Mon Sep 17 00:00:00 2001 From: Martin Zumsande Date: Fri, 16 Jun 2023 15:47:45 -0400 Subject: [PATCH] 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. --- src/validation.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/validation.cpp b/src/validation.cpp index d9a0fce34f2ec..542c1060a94e3 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -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