aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-05-13 13:38:32 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-05-13 13:42:41 +0000
commit5d882f4f14fec80a92b6233b258ec105478feb26 (patch)
tree73c598c04e6fc5deff1e646de646d94b59f1694e /src/cryptonote_core
parentMerge pull request #6510 (diff)
downloadmonero-5d882f4f14fec80a92b6233b258ec105478feb26.tar.xz
blockchain: fix theoretical race getting bulk timestamps
Diffstat (limited to 'src/cryptonote_core')
-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 2571e4203..093f9f779 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -890,6 +890,7 @@ difficulty_type Blockchain::get_difficulty_for_next_block()
//------------------------------------------------------------------
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;