From 5f8cd7b3a527999512161956db4d718688cb956f Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Tue, 15 Sep 2020 15:26:36 -0400 Subject: validation: Remove global ::ActivateBestChain Instead use CChainState::ActivateBestChain, which is what the global one calls anyway. --- src/validation.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/validation.h') 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 pblock = std::shared_ptr()); 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 pblock) LOCKS_EXCLUDED(cs_main); + std::shared_ptr pblock = nullptr) LOCKS_EXCLUDED(cs_main); bool AcceptBlock(const std::shared_ptr& pblock, BlockValidationState& state, const CChainParams& chainparams, CBlockIndex** ppindex, bool fRequested, const FlatFilePos* dbp, bool* fNewBlock) EXCLUSIVE_LOCKS_REQUIRED(cs_main); -- cgit v1.2.3