@ -1291,7 +1291,7 @@ void CChainState::InvalidBlockFound(CBlockIndex* pindex, const BlockValidationSt
{
if ( state . GetResult ( ) ! = BlockValidationResult : : BLOCK_MUTATED ) {
pindex - > nStatus | = BLOCK_FAILED_VALID ;
m_ block man. m_failed_blocks . insert ( pindex ) ;
m_ chain man. m_failed_blocks . insert ( pindex ) ;
setDirtyBlockIndex . insert ( pindex ) ;
setBlockIndexCandidates . erase ( pindex ) ;
InvalidChainFound ( pindex ) ;
@ -2844,7 +2844,7 @@ bool CChainState::InvalidateBlock(BlockValidationState& state, CBlockIndex* pind
to_mark_failed - > nStatus | = BLOCK_FAILED_VALID ;
setDirtyBlockIndex . insert ( to_mark_failed ) ;
setBlockIndexCandidates . erase ( to_mark_failed ) ;
m_ block man. m_failed_blocks . insert ( to_mark_failed ) ;
m_ chain man. m_failed_blocks . insert ( to_mark_failed ) ;
// If any new blocks somehow arrived while we were disconnecting
// (above), then the pre-calculation of what should go into
@ -2889,7 +2889,7 @@ void CChainState::ResetBlockFailureFlags(CBlockIndex *pindex) {
// Reset invalid block marker if it was pointing to one of those.
pindexBestInvalid = nullptr ;
}
m_ block man. m_failed_blocks . erase ( it - > second ) ;
m_ chain man. m_failed_blocks . erase ( it - > second ) ;
}
it + + ;
}
@ -2899,7 +2899,7 @@ void CChainState::ResetBlockFailureFlags(CBlockIndex *pindex) {
if ( pindex - > nStatus & BLOCK_FAILED_MASK ) {
pindex - > nStatus & = ~ BLOCK_FAILED_MASK ;
setDirtyBlockIndex . insert ( pindex ) ;
m_ block man. m_failed_blocks . erase ( pindex ) ;
m_ chain man. m_failed_blocks . erase ( pindex ) ;
}
pindex = pindex - > pprev ;
}
@ -3325,7 +3325,7 @@ bool ChainstateManager::AcceptBlockHeader(const CBlockHeader& block, BlockValida
// hasn't been validated up to BLOCK_VALID_SCRIPTS. This is a performance
// optimization, in the common case of adding a new block to the tip,
// we don't need to iterate over the failed blocks list.
for ( const CBlockIndex * failedit : m_ blockman. m_ failed_blocks) {
for ( const CBlockIndex * failedit : m_ failed_blocks) {
if ( pindexPrev - > GetAncestor ( failedit - > nHeight ) = = failedit ) {
assert ( failedit - > nStatus & BLOCK_FAILED_VALID ) ;
CBlockIndex * invalid_walk = pindexPrev ;
@ -3804,7 +3804,6 @@ bool BlockManager::LoadBlockIndex(
}
void BlockManager : : Unload ( ) {
m_failed_blocks . clear ( ) ;
m_blocks_unlinked . clear ( ) ;
for ( const BlockMap : : value_type & entry : m_block_index ) {
@ -5119,6 +5118,7 @@ void ChainstateManager::Unload()
chainstate - > UnloadBlockIndex ( ) ;
}
m_failed_blocks . clear ( ) ;
m_blockman . Unload ( ) ;
}