diff --git a/src/test/fuzz/coins_view.cpp b/src/test/fuzz/coins_view.cpp index 83193657ee..486124f6cb 100644 --- a/src/test/fuzz/coins_view.cpp +++ b/src/test/fuzz/coins_view.cpp @@ -307,12 +307,9 @@ void test_one_input(const std::vector &buffer) { CCoinsStats stats{CoinStatsHashType::HASH_SERIALIZED}; bool expected_code_path = false; try { - (void)GetUTXOStats( - &coins_view_cache, - WITH_LOCK(::cs_main, - return std::ref( - g_setup->m_node.chainman->m_blockman)), - stats); + (void)GetUTXOStats(&coins_view_cache, + g_setup->m_node.chainman->m_blockman, + stats); } catch (const std::logic_error &) { expected_code_path = true; } diff --git a/src/validation.cpp b/src/validation.cpp index 27a7ef87fc..9939a64576 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -6037,9 +6037,7 @@ bool ChainstateManager::PopulateAndValidateSnapshot( CCoinsViewDB *snapshot_coinsdb = WITH_LOCK(::cs_main, return &snapshot_chainstate.CoinsDB()); - if (!GetUTXOStats(snapshot_coinsdb, - WITH_LOCK(::cs_main, return std::ref(m_blockman)), stats, - breakpoint_fnc)) { + if (!GetUTXOStats(snapshot_coinsdb, m_blockman, stats, breakpoint_fnc)) { LogPrintf("[snapshot] failed to generate coins stats\n"); return false; } diff --git a/src/validation.h b/src/validation.h index afc2ad4323..f541054b5e 100644 --- a/src/validation.h +++ b/src/validation.h @@ -1148,7 +1148,7 @@ class ChainstateManager { std::thread m_load_block; //! A single BlockManager instance is shared across each constructed //! chainstate to avoid duplicating block metadata. - node::BlockManager m_blockman GUARDED_BY(::cs_main); + node::BlockManager m_blockman; /** * In order to efficiently track invalidity of headers, we keep the set of