aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/lmdb/db_lmdb.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-07-11 18:14:22 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-07-11 18:14:22 +0100
commitee31383a5209883cb6f22fd248ea5956718c66b2 (patch)
tree8e4ce8936b4c217eeaf7523ae0fa443ffbfc09f8 /src/blockchain_db/lmdb/db_lmdb.cpp
parentMerge pull request #4094 (diff)
downloadmonero-ee31383a5209883cb6f22fd248ea5956718c66b2.tar.xz
db_lmdb: don't sync a read only DB
This would only throw
Diffstat (limited to 'src/blockchain_db/lmdb/db_lmdb.cpp')
-rw-r--r--src/blockchain_db/lmdb/db_lmdb.cpp3
1 files changed, 3 insertions, 0 deletions
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))