diff options
author | MacroFake <falke.marco@gmail.com> | 2022-05-18 18:36:31 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-05-18 18:46:48 +0200 |
commit | fa1b76aeb064b315a3767a8f59836ca18aeb117e (patch) | |
tree | ab057aca9b58d826758f61a920f48ea0eb9ef241 /src/node | |
parent | fa30234be81b6f49ae8150478a9255daa1611083 (diff) | |
download | bitcoin-fa1b76aeb064b315a3767a8f59836ca18aeb117e.tar.xz |
Do not call global Params() when chainman is in scope
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/interfaces.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp index 954bd1c31d..44c23b85e1 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -228,7 +228,7 @@ public: uint256 getBestBlockHash() override { const CBlockIndex* tip = WITH_LOCK(::cs_main, return chainman().ActiveChain().Tip()); - return tip ? tip->GetBlockHash() : Params().GenesisBlock().GetHash(); + return tip ? tip->GetBlockHash() : chainman().GetParams().GenesisBlock().GetHash(); } int64_t getLastBlockTime() override { @@ -236,7 +236,7 @@ public: if (chainman().ActiveChain().Tip()) { return chainman().ActiveChain().Tip()->GetBlockTime(); } - return Params().GenesisBlock().GetBlockTime(); // Genesis block's time of current network + return chainman().GetParams().GenesisBlock().GetBlockTime(); // Genesis block's time of current network } double getVerificationProgress() override { @@ -245,7 +245,7 @@ public: LOCK(::cs_main); tip = chainman().ActiveChain().Tip(); } - return GuessVerificationProgress(Params().TxData(), tip); + return GuessVerificationProgress(chainman().GetParams().TxData(), tip); } bool isInitialBlockDownload() override { return chainman().ActiveChainstate().IsInitialBlockDownload(); @@ -546,7 +546,7 @@ public: double guessVerificationProgress(const uint256& block_hash) override { LOCK(cs_main); - return GuessVerificationProgress(Params().TxData(), chainman().m_blockman.LookupBlockIndex(block_hash)); + return GuessVerificationProgress(chainman().GetParams().TxData(), chainman().m_blockman.LookupBlockIndex(block_hash)); } bool hasBlocks(const uint256& block_hash, int min_height, std::optional<int> max_height) override { |