aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Blair <snipa@jagtech.io>2020-07-19 03:34:52 -0700
committerAlexander Blair <snipa@jagtech.io>2020-07-19 03:34:52 -0700
commit814e6171176673d2e7592cc3812497b1ccc75da8 (patch)
tree5ff6e8c40d50539d6d13780bd656992336387736
parentMerge pull request #6516 (diff)
parentblockchain: fix theoretical race getting bulk timestamps (diff)
downloadmonero-814e6171176673d2e7592cc3812497b1ccc75da8.tar.xz
Merge pull request #6526
5d882f4f1 blockchain: fix theoretical race getting bulk timestamps (moneromooo-monero)
-rw-r--r--src/cryptonote_core/blockchain.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index 608d250fe..7b8723c0c 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -962,6 +962,7 @@ start:
//------------------------------------------------------------------
std::vector<time_t> Blockchain::get_last_block_timestamps(unsigned int blocks) const
{
+ CRITICAL_REGION_LOCAL(m_blockchain_lock);
uint64_t height = m_db->height();
if (blocks > height)
blocks = height;