@@ -142,7 +142,7 @@ class CChainState {
142
142
* ahead and mark descendants of invalid blocks as FAILED_CHILD at that time,
143
143
* instead of putting things in this set.
144
144
*/
145
- std::set<CBlockIndex*> g_failed_blocks ;
145
+ std::set<CBlockIndex*> m_failed_blocks ;
146
146
147
147
public:
148
148
CChain chainActive;
@@ -1286,7 +1286,7 @@ void static InvalidChainFound(CBlockIndex* pindexNew)
1286
1286
void CChainState::InvalidBlockFound (CBlockIndex *pindex, const CValidationState &state) {
1287
1287
if (!state.CorruptionPossible ()) {
1288
1288
pindex->nStatus |= BLOCK_FAILED_VALID;
1289
- g_failed_blocks .insert (pindex);
1289
+ m_failed_blocks .insert (pindex);
1290
1290
setDirtyBlockIndex.insert (pindex);
1291
1291
setBlockIndexCandidates.erase (pindex);
1292
1292
InvalidChainFound (pindex);
@@ -2783,7 +2783,7 @@ bool CChainState::InvalidateBlock(CValidationState& state, const CChainParams& c
2783
2783
pindex->nStatus |= BLOCK_FAILED_VALID;
2784
2784
setDirtyBlockIndex.insert (pindex);
2785
2785
setBlockIndexCandidates.erase (pindex);
2786
- g_failed_blocks .insert (pindex);
2786
+ m_failed_blocks .insert (pindex);
2787
2787
2788
2788
// DisconnectTip will add transactions to disconnectpool; try to add these
2789
2789
// back to the mempool.
@@ -2829,7 +2829,7 @@ bool CChainState::ResetBlockFailureFlags(CBlockIndex *pindex) {
2829
2829
// Reset invalid block marker if it was pointing to one of those.
2830
2830
pindexBestInvalid = nullptr ;
2831
2831
}
2832
- g_failed_blocks .erase (it->second );
2832
+ m_failed_blocks .erase (it->second );
2833
2833
}
2834
2834
it++;
2835
2835
}
@@ -3323,7 +3323,7 @@ bool CChainState::AcceptBlockHeader(const CBlockHeader& block, CValidationState&
3323
3323
return error (" %s: Consensus::ContextualCheckBlockHeader: %s, %s" , __func__, hash.ToString (), FormatStateMessage (state));
3324
3324
3325
3325
if (!pindexPrev->IsValid (BLOCK_VALID_SCRIPTS)) {
3326
- for (const CBlockIndex* failedit : g_failed_blocks ) {
3326
+ for (const CBlockIndex* failedit : m_failed_blocks ) {
3327
3327
if (pindexPrev->GetAncestor (failedit->nHeight ) == failedit) {
3328
3328
assert (failedit->nStatus & BLOCK_FAILED_VALID);
3329
3329
CBlockIndex* invalid_walk = pindexPrev;
@@ -4189,7 +4189,7 @@ bool RewindBlockIndex(const CChainParams& params) {
4189
4189
4190
4190
void CChainState::UnloadBlockIndex () {
4191
4191
nBlockSequenceId = 1 ;
4192
- g_failed_blocks .clear ();
4192
+ m_failed_blocks .clear ();
4193
4193
setBlockIndexCandidates.clear ();
4194
4194
}
4195
4195
0 commit comments