mirror of
https://github.com/monero-project/monero.git
synced 2025-07-24 20:55:21 -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
|
@ -226,7 +226,7 @@ uint64_t Blockchain::get_current_blockchain_height() const
|
|||
//------------------------------------------------------------------
|
||||
//FIXME: possibly move this into the constructor, to avoid accidentally
|
||||
// dereferencing a null BlockchainDB pointer
|
||||
bool Blockchain::init(const std::string& config_folder, bool testnet)
|
||||
bool Blockchain::init(const std::string& config_folder, const bool testnet, const int db_flags)
|
||||
{
|
||||
LOG_PRINT_L3("Blockchain::" << __func__);
|
||||
CRITICAL_REGION_LOCAL(m_blockchain_lock);
|
||||
|
@ -246,7 +246,7 @@ bool Blockchain::init(const std::string& config_folder, bool testnet)
|
|||
const std::string filename = folder.string();
|
||||
try
|
||||
{
|
||||
m_db->open(filename);
|
||||
m_db->open(filename, db_flags);
|
||||
}
|
||||
catch (const DB_OPEN_FAILURE& e)
|
||||
{
|
||||
|
|
|
@ -81,7 +81,7 @@ namespace cryptonote
|
|||
|
||||
Blockchain(tx_memory_pool& tx_pool);
|
||||
|
||||
bool init(const std::string& config_folder, bool testnet = false);
|
||||
bool init(const std::string& config_folder, const bool testnet = false, const int db_flags = 0);
|
||||
bool deinit();
|
||||
|
||||
void set_checkpoints(checkpoints&& chk_pts) { m_checkpoints = chk_pts; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue