diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2019-02-15 10:41:48 +0100 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2019-02-15 10:41:52 +0100 |
commit | 543ef7d626177a5cc4e0f5c7f01bca0946782d1c (patch) | |
tree | 555da7db84222843ae03bfaa8f2667dd848ce71e /src/bench/duplicate_inputs.cpp | |
parent | c576979b78b541bf3b4a7cbeee989b55d268e3e1 (diff) |
tests: Add missing cs_main locks required when accessing pcoinsdbview, pcoinsTip or pblocktree
Diffstat (limited to 'src/bench/duplicate_inputs.cpp')
-rw-r--r-- | src/bench/duplicate_inputs.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bench/duplicate_inputs.cpp b/src/bench/duplicate_inputs.cpp index e0854e2c62..1f6840d813 100644 --- a/src/bench/duplicate_inputs.cpp +++ b/src/bench/duplicate_inputs.cpp @@ -37,10 +37,12 @@ static void DuplicateInputs(benchmark::State& state) CScheduler scheduler; const CChainParams& chainparams = Params(); { + LOCK(cs_main); ::pblocktree.reset(new CBlockTreeDB(1 << 20, true)); ::pcoinsdbview.reset(new CCoinsViewDB(1 << 23, true)); ::pcoinsTip.reset(new CCoinsViewCache(pcoinsdbview.get())); - + } + { thread_group.create_thread(std::bind(&CScheduler::serviceQueue, &scheduler)); GetMainSignals().RegisterBackgroundSignalScheduler(scheduler); LoadGenesisBlock(chainparams); |