aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_converter
diff options
context:
space:
mode:
authorwarptangent <warptangent@inbox.com>2015-05-01 00:46:23 -0700
committerwarptangent <warptangent@inbox.com>2015-05-08 14:04:37 -0700
commit48926d0eeb732e0e32a00be8f6d8f3e1831d3fda (patch)
tree6befc6cb224e2bb0f5a14a2427efbd1dbfb5e6bd /src/blockchain_converter
parentMerge pull request #269 (diff)
downloadmonero-48926d0eeb732e0e32a00be8f6d8f3e1831d3fda.tar.xz
Fix incompatibility with blockchain exporter when source is LMDB
Instantiate BlockchainDB in blockchain exporter to reflect recent updates. This applies when blockchain_export.h defines SOURCE_DB as DB_LMDB.
Diffstat (limited to 'src/blockchain_converter')
-rw-r--r--src/blockchain_converter/blockchain_export.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/blockchain_converter/blockchain_export.cpp b/src/blockchain_converter/blockchain_export.cpp
index dc5c7cadc..ed88661c4 100644
--- a/src/blockchain_converter/blockchain_export.cpp
+++ b/src/blockchain_converter/blockchain_export.cpp
@@ -382,7 +382,22 @@ int main(int argc, char* argv[])
Blockchain* core_storage = NULL;
tx_memory_pool m_mempool(*core_storage);
core_storage = new Blockchain(m_mempool);
- r = core_storage->init(m_config_folder, opt_testnet);
+
+ BlockchainDB* db = new BlockchainLMDB();
+ boost::filesystem::path folder(m_config_folder);
+ folder /= db->get_db_name();
+ LOG_PRINT_L0("Loading blockchain from folder " << folder.string() << " ...");
+ const std::string filename = folder.string();
+ try
+ {
+ db->open(filename);
+ }
+ catch (const std::exception& e)
+ {
+ LOG_PRINT_L0("Error opening database: " << e.what());
+ throw;
+ }
+ r = core_storage->init(db, opt_testnet);
#endif
CHECK_AND_ASSERT_MES(r, false, "Failed to initialize source blockchain storage");