@@ -1291,7 +1291,7 @@ void CChainState::InvalidBlockFound(CBlockIndex* pindex, const BlockValidationSt
1291
1291
{
1292
1292
if (state.GetResult () != BlockValidationResult::BLOCK_MUTATED) {
1293
1293
pindex->nStatus |= BLOCK_FAILED_VALID;
1294
- m_blockman .m_failed_blocks .insert (pindex);
1294
+ m_chainman .m_failed_blocks .insert (pindex);
1295
1295
setDirtyBlockIndex.insert (pindex);
1296
1296
setBlockIndexCandidates.erase (pindex);
1297
1297
InvalidChainFound (pindex);
@@ -2844,7 +2844,7 @@ bool CChainState::InvalidateBlock(BlockValidationState& state, CBlockIndex* pind
2844
2844
to_mark_failed->nStatus |= BLOCK_FAILED_VALID;
2845
2845
setDirtyBlockIndex.insert (to_mark_failed);
2846
2846
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);
2848
2848
2849
2849
// If any new blocks somehow arrived while we were disconnecting
2850
2850
// (above), then the pre-calculation of what should go into
@@ -2889,7 +2889,7 @@ void CChainState::ResetBlockFailureFlags(CBlockIndex *pindex) {
2889
2889
// Reset invalid block marker if it was pointing to one of those.
2890
2890
pindexBestInvalid = nullptr ;
2891
2891
}
2892
- m_blockman .m_failed_blocks .erase (it->second );
2892
+ m_chainman .m_failed_blocks .erase (it->second );
2893
2893
}
2894
2894
it++;
2895
2895
}
@@ -2899,7 +2899,7 @@ void CChainState::ResetBlockFailureFlags(CBlockIndex *pindex) {
2899
2899
if (pindex->nStatus & BLOCK_FAILED_MASK) {
2900
2900
pindex->nStatus &= ~BLOCK_FAILED_MASK;
2901
2901
setDirtyBlockIndex.insert (pindex);
2902
- m_blockman .m_failed_blocks .erase (pindex);
2902
+ m_chainman .m_failed_blocks .erase (pindex);
2903
2903
}
2904
2904
pindex = pindex->pprev ;
2905
2905
}
@@ -3325,7 +3325,7 @@ bool ChainstateManager::AcceptBlockHeader(const CBlockHeader& block, BlockValida
3325
3325
// hasn't been validated up to BLOCK_VALID_SCRIPTS. This is a performance
3326
3326
// optimization, in the common case of adding a new block to the tip,
3327
3327
// 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) {
3329
3329
if (pindexPrev->GetAncestor (failedit->nHeight ) == failedit) {
3330
3330
assert (failedit->nStatus & BLOCK_FAILED_VALID);
3331
3331
CBlockIndex* invalid_walk = pindexPrev;
@@ -3804,7 +3804,6 @@ bool BlockManager::LoadBlockIndex(
3804
3804
}
3805
3805
3806
3806
void BlockManager::Unload () {
3807
- m_failed_blocks.clear ();
3808
3807
m_blocks_unlinked.clear ();
3809
3808
3810
3809
for (const BlockMap::value_type& entry : m_block_index) {
@@ -5119,6 +5118,7 @@ void ChainstateManager::Unload()
5119
5118
chainstate->UnloadBlockIndex ();
5120
5119
}
5121
5120
5121
+ m_failed_blocks.clear ();
5122
5122
m_blockman.Unload ();
5123
5123
}
5124
5124
0 commit comments