mirror of
https://github.com/monero-project/monero.git
synced 2025-07-27 00:05:37 -04:00
Allow BlockchainLMDB to be opened in read-only mode
Have blockchain_export use read-only mode when source is BlockchainLMDB.
This commit is contained in:
parent
73d3511412
commit
d35bffb950
2 changed files with 11 additions and 4 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue