aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
authorAlexander Blair <snipa@jagtech.io>2021-01-03 18:29:39 -0800
committerAlexander Blair <snipa@jagtech.io>2021-01-03 18:29:39 -0800
commitf3de67bc2159960377845271f2657aa6b552e4b3 (patch)
tree8d2279b675b43313dc4b7c9953b5e25ec9d67d2c /src/cryptonote_core
parentMerge pull request #7264 (diff)
parentblockchain: lock access to m_blocks_hash_of_hashes (diff)
downloadmonero-f3de67bc2159960377845271f2657aa6b552e4b3.tar.xz
Merge pull request #7269
1128146c4 blockchain: lock access to m_blocks_hash_of_hashes (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core')
-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 e55700eba..c68cd84bb 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();