aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain.cpp
diff options
context:
space:
mode:
authorstoffu <stoffu@protonmail.ch>2018-06-04 20:46:24 +0900
committerstoffu <stoffu@protonmail.ch>2018-06-04 20:59:50 +0900
commitace2edacb6e229bd6467f76662a4faad3cc76666 (patch)
tree35928d5a5d91fe3f00d60cd7b6de269e566aced0 /src/cryptonote_core/blockchain.cpp
parentMerge pull request #3866 (diff)
downloadmonero-ace2edacb6e229bd6467f76662a4faad3cc76666.tar.xz
blockchain: pop forked blocks only when DB is not read-only
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
-rw-r--r--src/cryptonote_core/blockchain.cpp2
1 files changed, 1 insertions, 1 deletions
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();