aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_utilities/fake_core.h
diff options
context:
space:
mode:
authorwarptangent <warptangent@tutanota.com>2016-02-14 12:20:14 -0800
committerwarptangent <warptangent@tutanota.com>2016-02-14 16:02:38 -0800
commitcffc411c9025e1d28a8b6e32c53c83ba113d9204 (patch)
tree41a137741540e575846787af7ab5de71c0e4d30e /src/blockchain_utilities/fake_core.h
parentblockchain_import: Add database type argument (diff)
downloadmonero-cffc411c9025e1d28a8b6e32c53c83ba113d9204.tar.xz
blockchain_import: Support BerkeleyDB
Diffstat (limited to 'src/blockchain_utilities/fake_core.h')
-rw-r--r--src/blockchain_utilities/fake_core.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/blockchain_utilities/fake_core.h b/src/blockchain_utilities/fake_core.h
index cf2585f29..20a3361b6 100644
--- a/src/blockchain_utilities/fake_core.h
+++ b/src/blockchain_utilities/fake_core.h
@@ -33,6 +33,7 @@
#include "cryptonote_core/blockchain_storage.h" // in-memory DB
#include "blockchain_db/blockchain_db.h"
#include "blockchain_db/lmdb/db_lmdb.h"
+#include "blockchain_db/berkeleydb/db_bdb.h"
using namespace cryptonote;
@@ -65,7 +66,18 @@ struct fake_core_db
{
m_pool.init(path.string());
- BlockchainDB* db = new BlockchainLMDB();
+ BlockchainDB* db = nullptr;
+ if (db_type == "lmdb")
+ db = new BlockchainLMDB();
+#if defined(BERKELEY_DB)
+ else if (db_type == "berkeley")
+ db = new BlockchainBDB();
+#endif
+ else
+ {
+ LOG_ERROR("Attempted to use non-existent database type: " << db_type);
+ throw std::runtime_error("Attempting to use non-existent database type");
+ }
boost::filesystem::path folder(path);