aboutsummaryrefslogtreecommitdiff
path: root/src/bench
diff options
context:
space:
mode:
authorJames O'Beirne <james.obeirne@gmail.com>2019-03-27 11:14:25 -0400
committerJames O'Beirne <james.obeirne@gmail.com>2019-05-03 15:02:54 -0400
commit631940aab228ccca64c15e05d5953f40381a0ffc (patch)
tree694cfe15bf0a6d9271fc9b6c10fda5a77c935580 /src/bench
parenta3a609079c76dd2bbc72127488bf466cc61d8940 (diff)
downloadbitcoin-631940aab228ccca64c15e05d5953f40381a0ffc.tar.xz
scripted-diff: replace chainActive -> ::ChainActive()
Though at the moment ChainActive() simply references `g_chainstate.m_chain`, doing this change now clears the way for multiple chainstate usage and allows us to script the diff. -BEGIN VERIFY SCRIPT- git grep -l "chainActive" | grep -E '(h|cpp)$' | xargs sed -i '/chainActive =/b; /extern CChain& chainActive/b; s/\(::\)\{0,1\}chainActive/::ChainActive()/g' -END VERIFY SCRIPT-
Diffstat (limited to 'src/bench')
-rw-r--r--src/bench/bench.cpp4
-rw-r--r--src/bench/duplicate_inputs.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/bench/bench.cpp b/src/bench/bench.cpp
index b08ecbb621..d0e0109546 100644
--- a/src/bench/bench.cpp
+++ b/src/bench/bench.cpp
@@ -114,8 +114,8 @@ void benchmark::BenchRunner::RunAll(Printer& printer, uint64_t num_evals, double
for (const auto& p : benchmarks()) {
TestingSetup test{CBaseChainParams::REGTEST};
{
- assert(::chainActive.Height() == 0);
- const bool witness_enabled{IsWitnessEnabled(::chainActive.Tip(), Params().GetConsensus())};
+ assert(::ChainActive().Height() == 0);
+ const bool witness_enabled{IsWitnessEnabled(::ChainActive().Tip(), Params().GetConsensus())};
assert(witness_enabled);
}
diff --git a/src/bench/duplicate_inputs.cpp b/src/bench/duplicate_inputs.cpp
index 2d7a351523..aa3f219b18 100644
--- a/src/bench/duplicate_inputs.cpp
+++ b/src/bench/duplicate_inputs.cpp
@@ -29,7 +29,7 @@ static void DuplicateInputs(benchmark::State& state)
CMutableTransaction coinbaseTx{};
CMutableTransaction naughtyTx{};
- CBlockIndex* pindexPrev = ::chainActive.Tip();
+ CBlockIndex* pindexPrev = ::ChainActive().Tip();
assert(pindexPrev != nullptr);
block.nBits = GetNextWorkRequired(pindexPrev, &block, chainparams.GetConsensus());
block.nNonce = 0;