aboutsummaryrefslogtreecommitdiff
path: root/src/bench
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-04-19 13:19:20 -0400
committerMarcoFalke <falke.marco@gmail.com>2019-05-13 14:46:01 -0400
commitfa3c6511435149782545ac0d09d4722dc115d709 (patch)
tree4b50c659cd37aa21590050479c8e525ad017d9e1 /src/bench
parent14959753a424f04be118630f691ecab9b0df7e9e (diff)
[refactor] interfaces: Add missing LockAnnotation for cs_main
Diffstat (limited to 'src/bench')
-rw-r--r--src/bench/bench.cpp1
-rw-r--r--src/bench/duplicate_inputs.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/bench/bench.cpp b/src/bench/bench.cpp
index d0e0109546..f2b520e893 100644
--- a/src/bench/bench.cpp
+++ b/src/bench/bench.cpp
@@ -114,6 +114,7 @@ void benchmark::BenchRunner::RunAll(Printer& printer, uint64_t num_evals, double
for (const auto& p : benchmarks()) {
TestingSetup test{CBaseChainParams::REGTEST};
{
+ LOCK(cs_main);
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 aa3f219b18..80ff13612c 100644
--- a/src/bench/duplicate_inputs.cpp
+++ b/src/bench/duplicate_inputs.cpp
@@ -29,6 +29,7 @@ static void DuplicateInputs(benchmark::State& state)
CMutableTransaction coinbaseTx{};
CMutableTransaction naughtyTx{};
+ LOCK(cs_main);
CBlockIndex* pindexPrev = ::ChainActive().Tip();
assert(pindexPrev != nullptr);
block.nBits = GetNextWorkRequired(pindexPrev, &block, chainparams.GetConsensus());