Skip to content

Commit 3cc9094

Browse files
committed
scripted-diff: Rename CChainState::g_failed_blocks to m_failed_blocks
To reflect its actual status as a member rather than a global value. g_failed_blocks was previously global: 2862aca -BEGIN VERIFY SCRIPT- sed -i 's/g_failed_blocks/m_failed_blocks/g' src/validation.cpp -END VERIFY SCRIPT-
1 parent 615f7c2 commit 3cc9094

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/validation.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class CChainState {
142142
* ahead and mark descendants of invalid blocks as FAILED_CHILD at that time,
143143
* instead of putting things in this set.
144144
*/
145-
std::set<CBlockIndex*> g_failed_blocks;
145+
std::set<CBlockIndex*> m_failed_blocks;
146146

147147
public:
148148
CChain chainActive;
@@ -1286,7 +1286,7 @@ void static InvalidChainFound(CBlockIndex* pindexNew)
12861286
void CChainState::InvalidBlockFound(CBlockIndex *pindex, const CValidationState &state) {
12871287
if (!state.CorruptionPossible()) {
12881288
pindex->nStatus |= BLOCK_FAILED_VALID;
1289-
g_failed_blocks.insert(pindex);
1289+
m_failed_blocks.insert(pindex);
12901290
setDirtyBlockIndex.insert(pindex);
12911291
setBlockIndexCandidates.erase(pindex);
12921292
InvalidChainFound(pindex);
@@ -2783,7 +2783,7 @@ bool CChainState::InvalidateBlock(CValidationState& state, const CChainParams& c
27832783
pindex->nStatus |= BLOCK_FAILED_VALID;
27842784
setDirtyBlockIndex.insert(pindex);
27852785
setBlockIndexCandidates.erase(pindex);
2786-
g_failed_blocks.insert(pindex);
2786+
m_failed_blocks.insert(pindex);
27872787

27882788
// DisconnectTip will add transactions to disconnectpool; try to add these
27892789
// back to the mempool.
@@ -2829,7 +2829,7 @@ bool CChainState::ResetBlockFailureFlags(CBlockIndex *pindex) {
28292829
// Reset invalid block marker if it was pointing to one of those.
28302830
pindexBestInvalid = nullptr;
28312831
}
2832-
g_failed_blocks.erase(it->second);
2832+
m_failed_blocks.erase(it->second);
28332833
}
28342834
it++;
28352835
}
@@ -3323,7 +3323,7 @@ bool CChainState::AcceptBlockHeader(const CBlockHeader& block, CValidationState&
33233323
return error("%s: Consensus::ContextualCheckBlockHeader: %s, %s", __func__, hash.ToString(), FormatStateMessage(state));
33243324

33253325
if (!pindexPrev->IsValid(BLOCK_VALID_SCRIPTS)) {
3326-
for (const CBlockIndex* failedit : g_failed_blocks) {
3326+
for (const CBlockIndex* failedit : m_failed_blocks) {
33273327
if (pindexPrev->GetAncestor(failedit->nHeight) == failedit) {
33283328
assert(failedit->nStatus & BLOCK_FAILED_VALID);
33293329
CBlockIndex* invalid_walk = pindexPrev;
@@ -4189,7 +4189,7 @@ bool RewindBlockIndex(const CChainParams& params) {
41894189

41904190
void CChainState::UnloadBlockIndex() {
41914191
nBlockSequenceId = 1;
4192-
g_failed_blocks.clear();
4192+
m_failed_blocks.clear();
41934193
setBlockIndexCandidates.clear();
41944194
}
41954195

0 commit comments

Comments
 (0)