From ace2edacb6e229bd6467f76662a4faad3cc76666 Mon Sep 17 00:00:00 2001 From: stoffu Date: Mon, 4 Jun 2018 20:46:24 +0900 Subject: [PATCH] blockchain: pop forked blocks only when DB is not read-only --- src/cryptonote_core/blockchain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 54d8fac31..fb2d5f6be 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -444,7 +444,7 @@ bool Blockchain::init(BlockchainDB* db, const network_type nettype, bool offline m_db->block_txn_stop(); uint64_t num_popped_blocks = 0; - while (true) + while (!m_db->is_read_only()) { const uint64_t top_height = m_db->height() - 1; const crypto::hash top_id = m_db->top_block_hash();