mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
blockchain: lock the blockchain while pruning
This commit is contained in:
parent
1f809e7485
commit
bb0ef5b1f2
1 changed files with 4 additions and 0 deletions
|
@ -3896,6 +3896,10 @@ leave:
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
bool Blockchain::prune_blockchain(uint32_t pruning_seed)
|
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);
|
return m_db->prune_blockchain(pruning_seed);
|
||||||
}
|
}
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue