aboutsummaryrefslogtreecommitdiff
path: root/src/test/txvalidationcache_tests.cpp
diff options
context:
space:
mode:
authorMarcoFalke <[email protected]>2017-11-10 11:52:27 -0500
committerMarcoFalke <[email protected]>2017-11-10 11:54:16 -0500
commitee92243e66f2df03b3a759a8ffb75dc06f0cea0d (patch)
treec0c39162e9f995662f5115f471b55c0664aeb144 /src/test/txvalidationcache_tests.cpp
parentMerge #11316: [qt] Add use available balance in send coins dialog (CryptAxe, ... (diff)
parenttests: Add missing locks to tests (diff)
downloaddiscoin-ee92243e66f2df03b3a759a8ffb75dc06f0cea0d.tar.xz
discoin-ee92243e66f2df03b3a759a8ffb75dc06f0cea0d.zip
Merge #11623: tests: Add missing locks to tests
109a85899 tests: Add missing locks to tests (practicalswift) Pull request description: Add missing locks to tests to satisfy lock requirements (such as `EXCLUSIVE_LOCKS_REQUIRED(...)` (Clang Thread Safety Analysis, see #11226), `AssertLockHeld(...)` and implicit lock assumptions). Tree-SHA512: 1aaeb1da89df1779f02fcceff9d2f8ea24a3926d421f9ea305a19be04dd0b3e63d91f6c1ed22fb7e6988343f6a5288829a387ef872cfa7b6add57bd01046b5d9
Diffstat (limited to 'src/test/txvalidationcache_tests.cpp')
-rw-r--r--src/test/txvalidationcache_tests.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/test/txvalidationcache_tests.cpp b/src/test/txvalidationcache_tests.cpp
index 7d551a7bb..ce3060a5f 100644
--- a/src/test/txvalidationcache_tests.cpp
+++ b/src/test/txvalidationcache_tests.cpp
@@ -66,6 +66,7 @@ BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup)
// Test 1: block with both of those transactions should be rejected.
block = CreateAndProcessBlock(spends, scriptPubKey);
+ LOCK(cs_main);
BOOST_CHECK(chainActive.Tip()->GetBlockHash() != block.GetHash());
// Test 2: ... and should be rejected if spend1 is in the memory pool
@@ -151,7 +152,10 @@ BOOST_FIXTURE_TEST_CASE(checkinputs_test, TestChain100Setup)
{
// Test that passing CheckInputs with one set of script flags doesn't imply
// that we would pass again with a different set of flags.
- InitScriptExecutionCache();
+ {
+ LOCK(cs_main);
+ InitScriptExecutionCache();
+ }
CScript p2pk_scriptPubKey = CScript() << ToByteVector(coinbaseKey.GetPubKey()) << OP_CHECKSIG;
CScript p2sh_scriptPubKey = GetScriptForDestination(CScriptID(p2pk_scriptPubKey));