aboutsummaryrefslogtreecommitdiff
path: root/src/test/txvalidationcache_tests.cpp
diff options
context:
space:
mode:
authorpracticalswift <[email protected]>2019-02-15 10:41:48 +0100
committerpracticalswift <[email protected]>2019-02-15 10:41:52 +0100
commit543ef7d626177a5cc4e0f5c7f01bca0946782d1c (patch)
tree555da7db84222843ae03bfaa8f2667dd848ce71e /src/test/txvalidationcache_tests.cpp
parentMerge #14075: Import watch only pubkeys to the keypool if private keys are di... (diff)
downloaddiscoin-543ef7d626177a5cc4e0f5c7f01bca0946782d1c.tar.xz
discoin-543ef7d626177a5cc4e0f5c7f01bca0946782d1c.zip
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.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/test/txvalidationcache_tests.cpp b/src/test/txvalidationcache_tests.cpp
index c467f2783..4d04aae7e 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.
{