aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Blair <snipa@jagtech.io>2021-01-03 18:24:22 -0800
committerAlexander Blair <snipa@jagtech.io>2021-01-03 18:24:22 -0800
commit71f7d4e71e0c926f4b78b6a8d6a98cbe71f4ac57 (patch)
tree7ceffeb1b06fb33926f1cb0af9706ecaca5f58b4 /src
parentMerge pull request #7263 (diff)
parentblockchain: lock access to m_blocks_hash_of_hashes (diff)
downloadmonero-71f7d4e71e0c926f4b78b6a8d6a98cbe71f4ac57.tar.xz
Merge pull request #7268
1e27f7101 blockchain: lock access to m_blocks_hash_of_hashes (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_core/blockchain.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index 03a9ce6d6..8ec624254 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -4728,6 +4728,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();