aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-05-13 11:20:26 +0200
committerRiccardo Spagni <ric@spagni.net>2015-05-13 11:20:28 +0200
commita8a5939df34edecca271bddb1c066dbb30604dd3 (patch)
tree64248594afaa1867e50570a22ad3f1acaedf48d2 /src
parentMerge branch 'tewinget-sort_tx_by_fee_per_kb' (diff)
parentFix incompatibility with blockchain exporter when source is LMDB (diff)
downloadmonero-a8a5939df34edecca271bddb1c066dbb30604dd3.tar.xz
Merge pull request #277
48926d0 Fix incompatibility with blockchain exporter when source is LMDB (warptangent)
Diffstat (limited to 'src')
-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");