aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-07-27 14:30:57 -0500
committerluigi1111 <luigi1111w@gmail.com>2018-07-27 14:30:57 -0500
commit0dddfeacc982ad208808e3a828163837fc4aba38 (patch)
treecfb446fdfbfa6a16e0c1273205eeccaf852107eb
parentMerge pull request #4126 (diff)
parentdb_lmdb: don't sync a read only DB (diff)
downloadmonero-0dddfeacc982ad208808e3a828163837fc4aba38.tar.xz
Merge pull request #4129
ee31383 db_lmdb: don't sync a read only DB (moneromooo-monero)
-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 5d1679c0c..a6eb3d880 100644
--- a/src/blockchain_db/lmdb/db_lmdb.cpp
+++ b/src/blockchain_db/lmdb/db_lmdb.cpp
@@ -1413,6 +1413,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))