Skip to content

Commit

Permalink
db_lmdb: don't sync a read only DB
Browse files Browse the repository at this point in the history
This would only throw
  • Loading branch information
moneromooo-monero committed Jul 11, 2018
1 parent eed4dba commit ee31383
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/blockchain_db/lmdb/db_lmdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit ee31383

Please sign in to comment.