diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-07-11 18:14:22 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-07-11 18:14:22 +0100 |
commit | ee31383a5209883cb6f22fd248ea5956718c66b2 (patch) | |
tree | 8e4ce8936b4c217eeaf7523ae0fa443ffbfc09f8 | |
parent | Merge pull request #4094 (diff) | |
download | monero-ee31383a5209883cb6f22fd248ea5956718c66b2.tar.xz |
db_lmdb: don't sync a read only DB
This would only throw
Diffstat (limited to '')
-rw-r--r-- | src/blockchain_db/lmdb/db_lmdb.cpp | 3 |
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)) |