aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
authorwarptangent <warptangent@inbox.com>2015-02-11 16:02:20 -0800
committerwarptangent <warptangent@inbox.com>2015-03-16 00:26:59 -0700
commit275cbd4348975371988c79f67d68ceede3f47a1d (patch)
tree859bf49547cb9aa6ad4b2d3e846c8e8972830e9f /src/cryptonote_core
parentAdd mdb_flags variable to LMDB database open (diff)
downloadmonero-275cbd4348975371988c79f67d68ceede3f47a1d.tar.xz
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
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r--src/cryptonote_core/blockchain.cpp4
-rw-r--r--src/cryptonote_core/blockchain.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index b7920c99c..57934b3fc 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -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)
{
diff --git a/src/cryptonote_core/blockchain.h b/src/cryptonote_core/blockchain.h
index e86b3887e..da4da075b 100644
--- a/src/cryptonote_core/blockchain.h
+++ b/src/cryptonote_core/blockchain.h
@@ -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; }