aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/blockchain_db.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/blockchain_db/blockchain_db.cpp')
-rw-r--r--src/blockchain_db/blockchain_db.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/blockchain_db/blockchain_db.cpp b/src/blockchain_db/blockchain_db.cpp
index a6774a25c..c7ca533ef 100644
--- a/src/blockchain_db/blockchain_db.cpp
+++ b/src/blockchain_db/blockchain_db.cpp
@@ -33,6 +33,11 @@
#include "profile_tools.h"
#include "ringct/rctOps.h"
+#include "lmdb/db_lmdb.h"
+#ifdef BERKELEY_DB
+#include "berkeleydb/db_bdb.h"
+#endif
+
#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "blockchain.db"
@@ -41,6 +46,17 @@ using epee::string_tools::pod_to_hex;
namespace cryptonote
{
+BlockchainDB *new_db(const std::string& db_type)
+{
+ if (db_type == "lmdb")
+ return new BlockchainLMDB();
+#if defined(BERKELEY_DB)
+ if (db_type == "berkeley")
+ return new BlockchainBDB();
+#endif
+ return NULL;
+}
+
void BlockchainDB::pop_block()
{
block blk;