diff options
author | Jesus Ramirez <jesus.rami.serra@gmail.com> | 2019-06-26 10:39:41 -0400 |
---|---|---|
committer | Lev Sizov <levsizov2015@outlook.com> | 2019-09-16 16:18:05 +0200 |
commit | f9b3f6ef3b1ebde4dc9a1ef8e70b4ef7d807cede (patch) | |
tree | dcedafd5f01ae480df6c1f10688def08ec0b1800 /src/blockchain_db/blockchain_db.cpp | |
parent | Merge pull request #5793 (diff) | |
download | monero-f9b3f6ef3b1ebde4dc9a1ef8e70b4ef7d807cede.tar.xz |
Removed Berkeley DB and db switching logic
Diffstat (limited to 'src/blockchain_db/blockchain_db.cpp')
-rw-r--r-- | src/blockchain_db/blockchain_db.cpp | 52 |
1 files changed, 2 insertions, 50 deletions
diff --git a/src/blockchain_db/blockchain_db.cpp b/src/blockchain_db/blockchain_db.cpp index 2b039f557..63ac38a88 100644 --- a/src/blockchain_db/blockchain_db.cpp +++ b/src/blockchain_db/blockchain_db.cpp @@ -35,17 +35,6 @@ #include "ringct/rctOps.h" #include "lmdb/db_lmdb.h" -#ifdef BERKELEY_DB -#include "berkeleydb/db_bdb.h" -#endif - -static const char *db_types[] = { - "lmdb", -#ifdef BERKELEY_DB - "berkeley", -#endif - NULL -}; #undef MONERO_DEFAULT_LOG_CATEGORY #define MONERO_DEFAULT_LOG_CATEGORY "blockchain.db" @@ -55,36 +44,6 @@ using epee::string_tools::pod_to_hex; namespace cryptonote { -bool blockchain_valid_db_type(const std::string& db_type) -{ - int i; - for (i=0; db_types[i]; i++) - { - if (db_types[i] == db_type) - return true; - } - return false; -} - -std::string blockchain_db_types(const std::string& sep) -{ - int i; - std::string ret = ""; - for (i=0; db_types[i]; i++) - { - if (i) - ret += sep; - ret += db_types[i]; - } - return ret; -} - -std::string arg_db_type_description = "Specify database type, available: " + cryptonote::blockchain_db_types(", "); -const command_line::arg_descriptor<std::string> arg_db_type = { - "db-type" -, arg_db_type_description.c_str() -, DEFAULT_DB_TYPE -}; const command_line::arg_descriptor<std::string> arg_db_sync_mode = { "db-sync-mode" , "Specify sync option, using format [safe|fast|fastest]:[sync|async]:[<nblocks_per_sync>[blocks]|<nbytes_per_sync>[bytes]]." @@ -96,20 +55,13 @@ const command_line::arg_descriptor<bool> arg_db_salvage = { , false }; -BlockchainDB *new_db(const std::string& db_type) +BlockchainDB *new_db() { - if (db_type == "lmdb") - return new BlockchainLMDB(); -#if defined(BERKELEY_DB) - if (db_type == "berkeley") - return new BlockchainBDB(); -#endif - return NULL; + return new BlockchainLMDB(); } void BlockchainDB::init_options(boost::program_options::options_description& desc) { - command_line::add_arg(desc, arg_db_type); command_line::add_arg(desc, arg_db_sync_mode); command_line::add_arg(desc, arg_db_salvage); } |