@@ -1291,7 +1291,7 @@ void CChainState::InvalidBlockFound(CBlockIndex* pindex, const BlockValidationSt
12911291{
12921292 if (state.GetResult () != BlockValidationResult::BLOCK_MUTATED) {
12931293 pindex->nStatus |= BLOCK_FAILED_VALID;
1294- m_blockman .m_failed_blocks .insert (pindex);
1294+ m_chainman .m_failed_blocks .insert (pindex);
12951295 setDirtyBlockIndex.insert (pindex);
12961296 setBlockIndexCandidates.erase (pindex);
12971297 InvalidChainFound (pindex);
@@ -2844,7 +2844,7 @@ bool CChainState::InvalidateBlock(BlockValidationState& state, CBlockIndex* pind
28442844 to_mark_failed->nStatus |= BLOCK_FAILED_VALID;
28452845 setDirtyBlockIndex.insert (to_mark_failed);
28462846 setBlockIndexCandidates.erase (to_mark_failed);
2847- m_blockman .m_failed_blocks .insert (to_mark_failed);
2847+ m_chainman .m_failed_blocks .insert (to_mark_failed);
28482848
28492849 // If any new blocks somehow arrived while we were disconnecting
28502850 // (above), then the pre-calculation of what should go into
@@ -2889,7 +2889,7 @@ void CChainState::ResetBlockFailureFlags(CBlockIndex *pindex) {
28892889 // Reset invalid block marker if it was pointing to one of those.
28902890 pindexBestInvalid = nullptr ;
28912891 }
2892- m_blockman .m_failed_blocks .erase (it->second );
2892+ m_chainman .m_failed_blocks .erase (it->second );
28932893 }
28942894 it++;
28952895 }
@@ -2899,7 +2899,7 @@ void CChainState::ResetBlockFailureFlags(CBlockIndex *pindex) {
28992899 if (pindex->nStatus & BLOCK_FAILED_MASK) {
29002900 pindex->nStatus &= ~BLOCK_FAILED_MASK;
29012901 setDirtyBlockIndex.insert (pindex);
2902- m_blockman .m_failed_blocks .erase (pindex);
2902+ m_chainman .m_failed_blocks .erase (pindex);
29032903 }
29042904 pindex = pindex->pprev ;
29052905 }
@@ -3325,7 +3325,7 @@ bool ChainstateManager::AcceptBlockHeader(const CBlockHeader& block, BlockValida
33253325 // hasn't been validated up to BLOCK_VALID_SCRIPTS. This is a performance
33263326 // optimization, in the common case of adding a new block to the tip,
33273327 // we don't need to iterate over the failed blocks list.
3328- for (const CBlockIndex* failedit : m_blockman. m_failed_blocks ) {
3328+ for (const CBlockIndex* failedit : m_failed_blocks) {
33293329 if (pindexPrev->GetAncestor (failedit->nHeight ) == failedit) {
33303330 assert (failedit->nStatus & BLOCK_FAILED_VALID);
33313331 CBlockIndex* invalid_walk = pindexPrev;
@@ -3804,7 +3804,6 @@ bool BlockManager::LoadBlockIndex(
38043804}
38053805
38063806void BlockManager::Unload () {
3807- m_failed_blocks.clear ();
38083807 m_blocks_unlinked.clear ();
38093808
38103809 for (const BlockMap::value_type& entry : m_block_index) {
@@ -5119,6 +5118,7 @@ void ChainstateManager::Unload()
51195118 chainstate->UnloadBlockIndex ();
51205119 }
51215120
5121+ m_failed_blocks.clear ();
51225122 m_blockman.Unload ();
51235123}
51245124
0 commit comments