From 1128146c4990385f781d0b9c0dc77e28bf0cf133 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 2 Jan 2021 22:18:52 +0000 Subject: blockchain: lock access to m_blocks_hash_of_hashes it is accessed both when adding and when prevalidating a set of new hashes from a peer --- src/cryptonote_core/blockchain.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index cd5b4f455..206d5fbb9 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -4749,6 +4749,8 @@ uint64_t Blockchain::prevalidate_block_hashes(uint64_t height, const std::vector CHECK_AND_ASSERT_MES(weights.empty() || weights.size() == hashes.size(), 0, "Unexpected weights size"); + CRITICAL_REGION_LOCAL(m_blockchain_lock); + // easy case: height >= hashes if (height >= m_blocks_hash_of_hashes.size() * HASH_OF_HASHES_STEP) return hashes.size(); -- cgit v1.2.3