Skip to content

Commit 3e82abb

Browse files
committed
tree-wide: Remove stray review-only assertion
Unfortunately, these assertion don't fit the regex in the scripted-diff. Therefore, we remove it manually.
1 parent f323248 commit 3e82abb

File tree

2 files changed

+4
-38
lines changed

2 files changed

+4
-38
lines changed

src/miner.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,7 @@ void RegenerateCommitments(CBlock& block, ChainstateManager& chainman)
4545
tx.vout.erase(tx.vout.begin() + GetWitnessCommitmentIndex(block));
4646
block.vtx.at(0) = MakeTransactionRef(tx);
4747

48-
CBlockIndex* prev_block;
49-
{
50-
// TODO: Temporary scope to check correctness of refactored code.
51-
// Should be removed manually after merge of
52-
// https://github.com/bitcoin/bitcoin/pull/20158
53-
LOCK(::cs_main);
54-
assert(std::addressof(g_chainman.m_blockman) == std::addressof(chainman.m_blockman));
55-
prev_block = chainman.m_blockman.LookupBlockIndex(block.hashPrevBlock);
56-
}
48+
CBlockIndex* prev_block = WITH_LOCK(::cs_main, return chainman.m_blockman.LookupBlockIndex(block.hashPrevBlock));
5749
GenerateCoinbaseCommitment(block, prev_block, Params().GetConsensus());
5850

5951
block.hashMerkleRoot = BlockMerkleRoot(block);

src/node/interfaces.cpp

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,7 @@ class NodeImpl : public Node
202202
}
203203
uint256 getBestBlockHash() override
204204
{
205-
const CBlockIndex* tip;
206-
{
207-
// TODO: Temporary scope to check correctness of refactored code.
208-
// Should be removed manually after merge of
209-
// https://github.com/bitcoin/bitcoin/pull/20158
210-
LOCK(cs_main);
211-
assert(std::addressof(::ChainActive()) == std::addressof(chainman().ActiveChain()));
212-
tip = chainman().ActiveChain().Tip();
213-
}
205+
const CBlockIndex* tip = WITH_LOCK(::cs_main, return chainman().ActiveChain().Tip());
214206
return tip ? tip->GetBlockHash() : Params().GenesisBlock().GetHash();
215207
}
216208
int64_t getLastBlockTime() override
@@ -233,16 +225,7 @@ class NodeImpl : public Node
233225
return GuessVerificationProgress(Params().TxData(), tip);
234226
}
235227
bool isInitialBlockDownload() override {
236-
const CChainState* active_chainstate;
237-
{
238-
// TODO: Temporary scope to check correctness of refactored code.
239-
// Should be removed manually after merge of
240-
// https://github.com/bitcoin/bitcoin/pull/20158
241-
LOCK(::cs_main);
242-
active_chainstate = &m_context->chainman->ActiveChainstate();
243-
assert(std::addressof(::ChainstateActive()) == std::addressof(*active_chainstate));
244-
}
245-
return active_chainstate->IsInitialBlockDownload();
228+
return chainman().ActiveChainstate().IsInitialBlockDownload();
246229
}
247230
bool getReindex() override { return ::fReindex; }
248231
bool getImporting() override { return ::fImporting; }
@@ -647,16 +630,7 @@ class ChainImpl : public Chain
647630
}
648631
bool isReadyToBroadcast() override { return !::fImporting && !::fReindex && !isInitialBlockDownload(); }
649632
bool isInitialBlockDownload() override {
650-
const CChainState* active_chainstate;
651-
{
652-
// TODO: Temporary scope to check correctness of refactored code.
653-
// Should be removed manually after merge of
654-
// https://github.com/bitcoin/bitcoin/pull/20158
655-
LOCK(::cs_main);
656-
active_chainstate = &chainman().ActiveChainstate();
657-
assert(std::addressof(::ChainstateActive()) == std::addressof(*active_chainstate));
658-
}
659-
return active_chainstate->IsInitialBlockDownload();
633+
return chainman().ActiveChainstate().IsInitialBlockDownload();
660634
}
661635
bool shutdownRequested() override { return ShutdownRequested(); }
662636
int64_t getAdjustedTime() override { return GetAdjustedTime(); }

0 commit comments

Comments
 (0)