aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2020-09-09 15:37:31 -0400
committerCarl Dong <contact@carldong.me>2021-05-27 13:50:11 -0400
commit91226eb91769aad5a63bc671595e1353a2b2247a (patch)
tree291cdf4aee931e0fdd4841dc4213a9b03e943d58
parente6b4aa6eb53dc555ecab2922af35e7a2572faf4f (diff)
bench: Use existing NodeContext in DuplicateInputs
-rw-r--r--src/bench/duplicate_inputs.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bench/duplicate_inputs.cpp b/src/bench/duplicate_inputs.cpp
index 25d1a2b56c..4f6e1122b8 100644
--- a/src/bench/duplicate_inputs.cpp
+++ b/src/bench/duplicate_inputs.cpp
@@ -25,7 +25,8 @@ static void DuplicateInputs(benchmark::Bench& bench)
CMutableTransaction naughtyTx{};
LOCK(cs_main);
- CBlockIndex* pindexPrev = ::ChainActive().Tip();
+ assert(std::addressof(::ChainActive()) == std::addressof(testing_setup->m_node.chainman->ActiveChain()));
+ CBlockIndex* pindexPrev = testing_setup->m_node.chainman->ActiveChain().Tip();
assert(pindexPrev != nullptr);
block.nBits = GetNextWorkRequired(pindexPrev, &block, chainparams.GetConsensus());
block.nNonce = 0;