aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/lmdb/db_lmdb.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-12-30 09:36:54 +0200
committerRiccardo Spagni <ric@spagni.net>2015-12-30 09:36:54 +0200
commit9b3300fe9bdbfff28104f6d9a35a27827431dab2 (patch)
tree3eb3ddd3e6172b49bca6737bda3630537c418625 /src/blockchain_db/lmdb/db_lmdb.cpp
parentMerge pull request #568 (diff)
parentBlockchainDB: skip fixup check if read-only database (diff)
downloadmonero-9b3300fe9bdbfff28104f6d9a35a27827431dab2.tar.xz
Merge pull request #569
ee9d71e BlockchainDB: skip fixup check if read-only database (warptangent)
Diffstat (limited to 'src/blockchain_db/lmdb/db_lmdb.cpp')
-rw-r--r--src/blockchain_db/lmdb/db_lmdb.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp
index 325ed8b8c..d625e5a07 100644
--- a/src/blockchain_db/lmdb/db_lmdb.cpp
+++ b/src/blockchain_db/lmdb/db_lmdb.cpp
@@ -2496,8 +2496,22 @@ uint8_t BlockchainLMDB::get_hard_fork_version(uint64_t height) const
return ret;
}
+bool BlockchainLMDB::is_read_only() const
+{
+ unsigned int flags;
+ auto result = mdb_env_get_flags(m_env, &flags);
+ if (result)
+ throw0(DB_ERROR(std::string("Error getting database environment info: ").append(mdb_strerror(result)).c_str()));
+
+ if (flags & MDB_RDONLY)
+ return true;
+
+ return false;
+}
+
void BlockchainLMDB::fixup()
{
+ LOG_PRINT_L3("BlockchainLMDB::" << __func__);
// Always call parent as well
BlockchainDB::fixup();
}