mirror of
https://github.com/monero-project/monero.git
synced 2025-08-03 03:37:09 -04:00
Add support for database open with flags
Add support to: - BlockchainDB, BlockchainLMDB - blockchain_import utility to open LMDB database with one or more LMDB flags. Sample use: $ blockchain_import --database lmdb#nosync $ blockchain_import --database lmdb#nosync,nometasync
This commit is contained in:
parent
cb862cb81a
commit
275cbd4348
7 changed files with 77 additions and 14 deletions
|
@ -326,7 +326,7 @@ public:
|
|||
void show_stats();
|
||||
|
||||
// open the db at location <filename>, or create it if there isn't one.
|
||||
virtual void open(const std::string& filename) = 0;
|
||||
virtual void open(const std::string& filename, const int db_flags = 0) = 0;
|
||||
|
||||
// make sure implementation has a create function as well
|
||||
virtual void create(const std::string& filename) = 0;
|
||||
|
|
|
@ -635,9 +635,8 @@ BlockchainLMDB::BlockchainLMDB(bool batch_transactions)
|
|||
m_height = 0;
|
||||
}
|
||||
|
||||
void BlockchainLMDB::open(const std::string& filename)
|
||||
void BlockchainLMDB::open(const std::string& filename, const int mdb_flags)
|
||||
{
|
||||
int mdb_flags = 0;
|
||||
LOG_PRINT_L3("BlockchainLMDB::" << __func__);
|
||||
|
||||
if (m_open)
|
||||
|
|
|
@ -114,7 +114,7 @@ public:
|
|||
BlockchainLMDB(bool batch_transactions=false);
|
||||
~BlockchainLMDB();
|
||||
|
||||
virtual void open(const std::string& filename);
|
||||
virtual void open(const std::string& filename, const int mdb_flags=0);
|
||||
|
||||
virtual void create(const std::string& filename);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue