mirror of
https://github.com/monero-project/monero.git
synced 2024-12-23 03:59:33 +00:00
blockchain: pop forked blocks only when DB is not read-only
This commit is contained in:
parent
1380b70e74
commit
233a1ead22
1 changed files with 1 additions and 1 deletions
|
@ -442,7 +442,7 @@ bool Blockchain::init(BlockchainDB* db, const network_type nettype, bool offline
|
||||||
m_db->block_txn_stop();
|
m_db->block_txn_stop();
|
||||||
|
|
||||||
uint64_t num_popped_blocks = 0;
|
uint64_t num_popped_blocks = 0;
|
||||||
while (true)
|
while (!m_db->is_read_only())
|
||||||
{
|
{
|
||||||
const uint64_t top_height = m_db->height() - 1;
|
const uint64_t top_height = m_db->height() - 1;
|
||||||
const crypto::hash top_id = m_db->top_block_hash();
|
const crypto::hash top_id = m_db->top_block_hash();
|
||||||
|
|
Loading…
Reference in a new issue