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/test/txvalidationcache_tests.cpp | |
parent | c576979b78b541bf3b4a7cbeee989b55d268e3e1 (diff) | |
download | bitcoin-543ef7d626177a5cc4e0f5c7f01bca0946782d1c.tar.xz |
tests: Add missing cs_main locks required when accessing pcoinsdbview, pcoinsTip or pblocktree
Diffstat (limited to 'src/test/txvalidationcache_tests.cpp')
-rw-r--r-- | src/test/txvalidationcache_tests.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/test/txvalidationcache_tests.cpp b/src/test/txvalidationcache_tests.cpp index c467f27836..4d04aae7e9 100644 --- a/src/test/txvalidationcache_tests.cpp +++ b/src/test/txvalidationcache_tests.cpp @@ -102,7 +102,7 @@ BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup) // should fail. // Capture this interaction with the upgraded_nop argument: set it when evaluating // any script flag that is implemented as an upgraded NOP code. -static void ValidateCheckInputsForAllFlags(const CTransaction &tx, uint32_t failing_flags, bool add_to_cache) +static void ValidateCheckInputsForAllFlags(const CTransaction &tx, uint32_t failing_flags, bool add_to_cache) EXCLUSIVE_LOCKS_REQUIRED(cs_main) { PrecomputedTransactionData txdata(tx); // If we add many more flags, this loop can get too expensive, but we can @@ -219,11 +219,10 @@ BOOST_FIXTURE_TEST_CASE(checkinputs_test, TestChain100Setup) CBlock block; block = CreateAndProcessBlock({spend_tx}, p2pk_scriptPubKey); + LOCK(cs_main); BOOST_CHECK(chainActive.Tip()->GetBlockHash() == block.GetHash()); BOOST_CHECK(pcoinsTip->GetBestBlock() == block.GetHash()); - LOCK(cs_main); - // Test P2SH: construct a transaction that is valid without P2SH, and // then test validity with P2SH. { |