diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-04-15 12:29:25 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-04-15 22:27:12 +0000 |
commit | bb0ef5b1f276e54d7e7f191c793eca5c838da4f2 (patch) | |
tree | fbc995c2ec31181c5081908a402bd7bab5ddc6cb /src/cryptonote_core/blockchain.cpp | |
parent | Merge pull request #5440 (diff) | |
download | monero-bb0ef5b1f276e54d7e7f191c793eca5c838da4f2.tar.xz |
blockchain: lock the blockchain while pruning
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 7ef8f8c45..daa1fe517 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -3896,6 +3896,10 @@ leave: //------------------------------------------------------------------ bool Blockchain::prune_blockchain(uint32_t pruning_seed) { + m_tx_pool.lock(); + epee::misc_utils::auto_scope_leave_caller unlocker = epee::misc_utils::create_scope_leave_handler([&](){m_tx_pool.unlock();}); + CRITICAL_REGION_LOCAL(m_blockchain_lock); + return m_db->prune_blockchain(pruning_seed); } //------------------------------------------------------------------ |