diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2022-01-19 14:03:23 +0100 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2022-01-25 20:43:25 +0100 |
commit | 8ef457cb83fac796f8b6a56977b1016193fc1185 (patch) | |
tree | 7fc5ace30382fbfea8bd7429084eebbefe75d906 /src/test/validation_chainstatemanager_tests.cpp | |
parent | 572393448b4d32f91b92edc84b4200ab52d62422 (diff) |
Require CBlockIndex::IsAssumedValid() to hold cs_main
Diffstat (limited to 'src/test/validation_chainstatemanager_tests.cpp')
-rw-r--r-- | src/test/validation_chainstatemanager_tests.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/validation_chainstatemanager_tests.cpp b/src/test/validation_chainstatemanager_tests.cpp index f5742b65a1..26392e690d 100644 --- a/src/test/validation_chainstatemanager_tests.cpp +++ b/src/test/validation_chainstatemanager_tests.cpp @@ -235,7 +235,7 @@ BOOST_FIXTURE_TEST_CASE(chainstatemanager_activate_snapshot, TestChain100Setup) *chainman.SnapshotBlockhash()); // Ensure that the genesis block was not marked assumed-valid. - BOOST_CHECK(!chainman.ActiveChain().Genesis()->IsAssumedValid()); + BOOST_CHECK(WITH_LOCK(::cs_main, return !chainman.ActiveChain().Genesis()->IsAssumedValid())); const AssumeutxoData& au_data = *ExpectedAssumeutxo(snapshot_height, ::Params()); const CBlockIndex* tip = chainman.ActiveTip(); @@ -356,6 +356,7 @@ BOOST_FIXTURE_TEST_CASE(chainstatemanager_loadblockindex, TestChain100Setup) // Mark some region of the chain assumed-valid. for (int i = 0; i <= cs1.m_chain.Height(); ++i) { + LOCK(::cs_main); auto index = cs1.m_chain[i]; if (i < last_assumed_valid_idx && i >= assumed_valid_start_idx) { |