aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-06-20 14:39:09 -0500
committerluigi1111 <luigi1111w@gmail.com>2018-06-20 14:39:09 -0500
commit9eb51887b0b0f71191d1887e6fb96d5dda655a1a (patch)
treed41447943119973ecbcdebe4a1543a09d76159ce /src
parent5a221c0e4861ddd2a788f35e7b3e03389642fe41 (diff)
parentace2edacb6e229bd6467f76662a4faad3cc76666 (diff)
downloadmonzero-core-9eb51887b0b0f71191d1887e6fb96d5dda655a1a.tar.gz
monzero-core-9eb51887b0b0f71191d1887e6fb96d5dda655a1a.tar.xz
monzero-core-9eb51887b0b0f71191d1887e6fb96d5dda655a1a.zip
Merge pull request #3919
ace2eda blockchain: pop forked blocks only when DB is not read-only (stoffu)
Diffstat (limited to 'src')
-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 0448551c4..ad604deef 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();