diff options
author | warptangent <warptangent@inbox.com> | 2015-05-16 01:29:02 -0700 |
---|---|---|
committer | warptangent <warptangent@inbox.com> | 2015-05-16 01:34:58 -0700 |
commit | d35bffb950d7cdfc24c72ef098c3018befad14d6 (patch) | |
tree | a1a2a567dc2a224227a98a683624bd28ea837910 /src/blockchain_utilities/blockchain_export.cpp | |
parent | Rename "--block-number" option to "--block-stop" (diff) | |
download | monero-d35bffb950d7cdfc24c72ef098c3018befad14d6.tar.xz |
Allow BlockchainLMDB to be opened in read-only mode
Have blockchain_export use read-only mode when source is BlockchainLMDB.
Diffstat (limited to 'src/blockchain_utilities/blockchain_export.cpp')
-rw-r--r-- | src/blockchain_utilities/blockchain_export.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/blockchain_utilities/blockchain_export.cpp b/src/blockchain_utilities/blockchain_export.cpp index 6f67c61c3..ec885ea98 100644 --- a/src/blockchain_utilities/blockchain_export.cpp +++ b/src/blockchain_utilities/blockchain_export.cpp @@ -129,11 +129,14 @@ int main(int argc, char* argv[]) BlockchainDB* db = new BlockchainLMDB(); boost::filesystem::path folder(m_config_folder); folder /= db->get_db_name(); - LOG_PRINT_L0("Loading blockchain from folder " << folder.string() << " ..."); + int lmdb_flags = 0; + lmdb_flags |= MDB_RDONLY; const std::string filename = folder.string(); + + LOG_PRINT_L0("Loading blockchain from folder " << filename << " ..."); try { - db->open(filename); + db->open(filename, lmdb_flags); } catch (const std::exception& e) { |