mirror of
https://github.com/monero-project/monero.git
synced 2025-12-05 20:40:22 -08:00
Merge pull request #10192
38bc627 Blockchain: cancel pop_blocks() operation on interupt (jeffro256)
This commit is contained in:
@@ -562,7 +562,7 @@ void Blockchain::pop_blocks(uint64_t nblocks)
|
|||||||
const uint64_t blockchain_height = m_db->height();
|
const uint64_t blockchain_height = m_db->height();
|
||||||
if (blockchain_height > 0)
|
if (blockchain_height > 0)
|
||||||
nblocks = std::min(nblocks, blockchain_height - 1);
|
nblocks = std::min(nblocks, blockchain_height - 1);
|
||||||
while (i < nblocks)
|
while (i < nblocks && !m_cancel.load())
|
||||||
{
|
{
|
||||||
pop_block_from_blockchain();
|
pop_block_from_blockchain();
|
||||||
++i;
|
++i;
|
||||||
|
|||||||
Reference in New Issue
Block a user