diff options
author | Carl Dong <contact@carldong.me> | 2020-09-15 15:26:36 -0400 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2021-01-28 14:15:26 -0500 |
commit | 5f8cd7b3a527999512161956db4d718688cb956f (patch) | |
tree | b90e409cee9deb189cad076e0cfde747525666c6 /src/validation.h | |
parent | 2a696472a1423e877bfa83f016f66c7e45be7369 (diff) |
validation: Remove global ::ActivateBestChain
Instead use CChainState::ActivateBestChain, which is what the global one
calls anyway.
Diffstat (limited to 'src/validation.h')
-rw-r--r-- | src/validation.h | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/validation.h b/src/validation.h index 10a2f8f804..f55c0d4c31 100644 --- a/src/validation.h +++ b/src/validation.h @@ -167,13 +167,6 @@ void StopScriptCheckWorkerThreads(); * @returns The tx if found, otherwise nullptr */ CTransactionRef GetTransaction(const CBlockIndex* const block_index, const CTxMemPool* const mempool, const uint256& hash, const Consensus::Params& consensusParams, uint256& hashBlock); -/** - * Find the best known block, and make it the tip of the block chain - * - * May not be called with cs_main held. May not be called in a - * validationinterface callback. - */ -bool ActivateBestChain(BlockValidationState& state, const CChainParams& chainparams, std::shared_ptr<const CBlock> pblock = std::shared_ptr<const CBlock>()); CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams); /** Guess verification progress (as a fraction between 0.0=genesis and 1.0=current tip). */ @@ -648,6 +641,8 @@ public: void PruneAndFlush(); /** + * Find the best known block, and make it the tip of the block chain + * * Make the best chain active, in multiple steps. The result is either failure * or an activated best chain. pblock is either nullptr or a pointer to a block * that is already loaded (to avoid loading it again from disk). @@ -664,7 +659,7 @@ public: bool ActivateBestChain( BlockValidationState& state, const CChainParams& chainparams, - std::shared_ptr<const CBlock> pblock) LOCKS_EXCLUDED(cs_main); + std::shared_ptr<const CBlock> pblock = nullptr) LOCKS_EXCLUDED(cs_main); bool AcceptBlock(const std::shared_ptr<const CBlock>& pblock, BlockValidationState& state, const CChainParams& chainparams, CBlockIndex** ppindex, bool fRequested, const FlatFilePos* dbp, bool* fNewBlock) EXCLUSIVE_LOCKS_REQUIRED(cs_main); |