aboutsummaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2020-11-04 17:18:09 -0500
committerCarl Dong <contact@carldong.me>2021-06-10 15:04:39 -0400
commit3e82abb8dd7e21ec918966105648be7ae077fd8c (patch)
treee06a808ce6e0b98b601084e70d5fddee67057ef6 /src/node
parentf323248aba5088c9630e5cdfe5ce980f21633fe8 (diff)
downloadbitcoin-3e82abb8dd7e21ec918966105648be7ae077fd8c.tar.xz
tree-wide: Remove stray review-only assertion
Unfortunately, these assertion don't fit the regex in the scripted-diff. Therefore, we remove it manually.
Diffstat (limited to 'src/node')
-rw-r--r--src/node/interfaces.cpp32
1 files changed, 3 insertions, 29 deletions
diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp
index 171f15d4fb..0c5fa419cf 100644
--- a/src/node/interfaces.cpp
+++ b/src/node/interfaces.cpp
@@ -202,15 +202,7 @@ public:
}
uint256 getBestBlockHash() override
{
- const CBlockIndex* tip;
- {
- // TODO: Temporary scope to check correctness of refactored code.
- // Should be removed manually after merge of
- // https://github.com/bitcoin/bitcoin/pull/20158
- LOCK(cs_main);
- assert(std::addressof(::ChainActive()) == std::addressof(chainman().ActiveChain()));
- tip = chainman().ActiveChain().Tip();
- }
+ const CBlockIndex* tip = WITH_LOCK(::cs_main, return chainman().ActiveChain().Tip());
return tip ? tip->GetBlockHash() : Params().GenesisBlock().GetHash();
}
int64_t getLastBlockTime() override
@@ -233,16 +225,7 @@ public:
return GuessVerificationProgress(Params().TxData(), tip);
}
bool isInitialBlockDownload() override {
- const CChainState* active_chainstate;
- {
- // TODO: Temporary scope to check correctness of refactored code.
- // Should be removed manually after merge of
- // https://github.com/bitcoin/bitcoin/pull/20158
- LOCK(::cs_main);
- active_chainstate = &m_context->chainman->ActiveChainstate();
- assert(std::addressof(::ChainstateActive()) == std::addressof(*active_chainstate));
- }
- return active_chainstate->IsInitialBlockDownload();
+ return chainman().ActiveChainstate().IsInitialBlockDownload();
}
bool getReindex() override { return ::fReindex; }
bool getImporting() override { return ::fImporting; }
@@ -647,16 +630,7 @@ public:
}
bool isReadyToBroadcast() override { return !::fImporting && !::fReindex && !isInitialBlockDownload(); }
bool isInitialBlockDownload() override {
- const CChainState* active_chainstate;
- {
- // TODO: Temporary scope to check correctness of refactored code.
- // Should be removed manually after merge of
- // https://github.com/bitcoin/bitcoin/pull/20158
- LOCK(::cs_main);
- active_chainstate = &chainman().ActiveChainstate();
- assert(std::addressof(::ChainstateActive()) == std::addressof(*active_chainstate));
- }
- return active_chainstate->IsInitialBlockDownload();
+ return chainman().ActiveChainstate().IsInitialBlockDownload();
}
bool shutdownRequested() override { return ShutdownRequested(); }
int64_t getAdjustedTime() override { return GetAdjustedTime(); }