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: 2862aca40f

-BEGIN VERIFY SCRIPT-
sed -i 's/g_failed_blocks/m_failed_blocks/g' src/validation.cpp
-END VERIFY SCRIPT-
This commit is contained in:
Ben Woosley 2018-04-18 04:57:18 -07:00
parent 615f7c2884
commit 3cc9094d36
No known key found for this signature in database
GPG Key ID: 6EE5F3785F78B345

View File

@ -142,7 +142,7 @@ private:
* ahead and mark descendants of invalid blocks as FAILED_CHILD at that time, * ahead and mark descendants of invalid blocks as FAILED_CHILD at that time,
* instead of putting things in this set. * instead of putting things in this set.
*/ */
std::set<CBlockIndex*> g_failed_blocks; std::set<CBlockIndex*> m_failed_blocks;
public: public:
CChain chainActive; CChain chainActive;
@ -1286,7 +1286,7 @@ void static InvalidChainFound(CBlockIndex* pindexNew)
void CChainState::InvalidBlockFound(CBlockIndex *pindex, const CValidationState &state) { void CChainState::InvalidBlockFound(CBlockIndex *pindex, const CValidationState &state) {
if (!state.CorruptionPossible()) { if (!state.CorruptionPossible()) {
pindex->nStatus |= BLOCK_FAILED_VALID; pindex->nStatus |= BLOCK_FAILED_VALID;
g_failed_blocks.insert(pindex); m_failed_blocks.insert(pindex);
setDirtyBlockIndex.insert(pindex); setDirtyBlockIndex.insert(pindex);
setBlockIndexCandidates.erase(pindex); setBlockIndexCandidates.erase(pindex);
InvalidChainFound(pindex); InvalidChainFound(pindex);
@ -2783,7 +2783,7 @@ bool CChainState::InvalidateBlock(CValidationState& state, const CChainParams& c
pindex->nStatus |= BLOCK_FAILED_VALID; pindex->nStatus |= BLOCK_FAILED_VALID;
setDirtyBlockIndex.insert(pindex); setDirtyBlockIndex.insert(pindex);
setBlockIndexCandidates.erase(pindex); setBlockIndexCandidates.erase(pindex);
g_failed_blocks.insert(pindex); m_failed_blocks.insert(pindex);
// DisconnectTip will add transactions to disconnectpool; try to add these // DisconnectTip will add transactions to disconnectpool; try to add these
// back to the mempool. // back to the mempool.
@ -2829,7 +2829,7 @@ bool CChainState::ResetBlockFailureFlags(CBlockIndex *pindex) {
// Reset invalid block marker if it was pointing to one of those. // Reset invalid block marker if it was pointing to one of those.
pindexBestInvalid = nullptr; pindexBestInvalid = nullptr;
} }
g_failed_blocks.erase(it->second); m_failed_blocks.erase(it->second);
} }
it++; it++;
} }
@ -3323,7 +3323,7 @@ bool CChainState::AcceptBlockHeader(const CBlockHeader& block, CValidationState&
return error("%s: Consensus::ContextualCheckBlockHeader: %s, %s", __func__, hash.ToString(), FormatStateMessage(state)); return error("%s: Consensus::ContextualCheckBlockHeader: %s, %s", __func__, hash.ToString(), FormatStateMessage(state));
if (!pindexPrev->IsValid(BLOCK_VALID_SCRIPTS)) { if (!pindexPrev->IsValid(BLOCK_VALID_SCRIPTS)) {
for (const CBlockIndex* failedit : g_failed_blocks) { for (const CBlockIndex* failedit : m_failed_blocks) {
if (pindexPrev->GetAncestor(failedit->nHeight) == failedit) { if (pindexPrev->GetAncestor(failedit->nHeight) == failedit) {
assert(failedit->nStatus & BLOCK_FAILED_VALID); assert(failedit->nStatus & BLOCK_FAILED_VALID);
CBlockIndex* invalid_walk = pindexPrev; CBlockIndex* invalid_walk = pindexPrev;
@ -4189,7 +4189,7 @@ bool RewindBlockIndex(const CChainParams& params) {
void CChainState::UnloadBlockIndex() { void CChainState::UnloadBlockIndex() {
nBlockSequenceId = 1; nBlockSequenceId = 1;
g_failed_blocks.clear(); m_failed_blocks.clear();
setBlockIndexCandidates.clear(); setBlockIndexCandidates.clear();
} }