diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -3098,6 +3098,9 @@ // BLOCK_FAILED_CHILD status in future iterations, or, if it's the last // one, call InvalidChainFound on it. to_mark_failed_or_parked = invalid_walk_tip; + + // Block index must always be in a good state before we unlock cs_main. + CheckBlockIndex(config.GetChainParams().GetConsensus()); } { @@ -3133,6 +3136,9 @@ if (invalidate) { InvalidChainFound(to_mark_failed_or_parked); } + + // Block index must always be in a good state before we unlock cs_main. + CheckBlockIndex(config.GetChainParams().GetConsensus()); } // Only notify about a new block tip if the active chain was modified.