From ee31383a5209883cb6f22fd248ea5956718c66b2 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 11 Jul 2018 18:14:22 +0100 Subject: db_lmdb: don't sync a read only DB This would only throw --- src/blockchain_db/lmdb/db_lmdb.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/blockchain_db/lmdb') diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index 367bfa49e..034574349 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -1391,6 +1391,9 @@ void BlockchainLMDB::sync() LOG_PRINT_L3("BlockchainLMDB::" << __func__); check_open(); + if (is_read_only()) + return; + // Does nothing unless LMDB environment was opened with MDB_NOSYNC or in part // MDB_NOMETASYNC. Force flush to be synchronous. if (auto result = mdb_env_sync(m_env, true)) -- cgit v1.2.3