mirror of
https://github.com/monero-project/monero.git
synced 2025-01-23 19:15:57 +00:00
blockchain: do not try to pop blocks down to the genesis block
This commit is contained in:
parent
8f2a99d8ab
commit
a663ccba71
1 changed files with 3 additions and 0 deletions
|
@ -624,6 +624,9 @@ void Blockchain::pop_blocks(uint64_t nblocks)
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
const uint64_t blockchain_height = m_db->height();
|
||||||
|
if (blockchain_height > 0)
|
||||||
|
nblocks = std::min(nblocks, blockchain_height - 1);
|
||||||
for (i=0; i < nblocks; ++i)
|
for (i=0; i < nblocks; ++i)
|
||||||
{
|
{
|
||||||
pop_block_from_blockchain();
|
pop_block_from_blockchain();
|
||||||
|
|
Loading…
Reference in a new issue