mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-16 18:39:59 +01:00
tests: Add missing locks to tests
Add missing locks to tests to satisfy lock requirements (such as EXCLUSIVE_LOCKS_REQUIRED(...) (Clang Thread Safety Analysis), AssertLockHeld(...) and implicit lock assumptions).
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user