diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-04-18 09:55:57 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-05-21 09:56:16 -0400 |
commit | fa1d97b25686a5caca623599f6d608fd08616fe8 (patch) | |
tree | 512acf98aae5436c61ba7870c0876ea611ae1210 /src/validation.cpp | |
parent | fa24d4909864096934577abc26cfa9be47f634ba (diff) |
validation: Make ProcessNewBlock*() members of ChainstateManager
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index e684a7f7e6..dbdf5028fd 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -3691,13 +3691,14 @@ bool BlockManager::AcceptBlockHeader(const CBlockHeader& block, BlockValidationS } // Exposed wrapper for AcceptBlockHeader -bool ProcessNewBlockHeaders(const std::vector<CBlockHeader>& headers, BlockValidationState& state, const CChainParams& chainparams, const CBlockIndex** ppindex) +bool ChainstateManager::ProcessNewBlockHeaders(const std::vector<CBlockHeader>& headers, BlockValidationState& state, const CChainParams& chainparams, const CBlockIndex** ppindex) { + AssertLockNotHeld(cs_main); { LOCK(cs_main); for (const CBlockHeader& header : headers) { CBlockIndex *pindex = nullptr; // Use a temp pindex instead of ppindex to avoid a const_cast - bool accepted = g_chainman.m_blockman.AcceptBlockHeader( + bool accepted = m_blockman.AcceptBlockHeader( header, state, chainparams, &pindex); ::ChainstateActive().CheckBlockIndex(chainparams.GetConsensus()); @@ -3819,7 +3820,7 @@ bool CChainState::AcceptBlock(const std::shared_ptr<const CBlock>& pblock, Block return true; } -bool ProcessNewBlock(const CChainParams& chainparams, const std::shared_ptr<const CBlock> pblock, bool fForceProcessing, bool *fNewBlock) +bool ChainstateManager::ProcessNewBlock(const CChainParams& chainparams, const std::shared_ptr<const CBlock> pblock, bool fForceProcessing, bool* fNewBlock) { AssertLockNotHeld(cs_main); |