Merge pull request #277

48926d0 Fix incompatibility with blockchain exporter when source is LMDB (warptangent)
This commit is contained in:
Riccardo Spagni 2015-05-13 11:20:26 +02:00
commit a8a5939df3
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD

View file

@ -382,7 +382,22 @@ int main(int argc, char* argv[])
Blockchain* core_storage = NULL; Blockchain* core_storage = NULL;
tx_memory_pool m_mempool(*core_storage); tx_memory_pool m_mempool(*core_storage);
core_storage = new Blockchain(m_mempool); 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 #endif
CHECK_AND_ASSERT_MES(r, false, "Failed to initialize source blockchain storage"); CHECK_AND_ASSERT_MES(r, false, "Failed to initialize source blockchain storage");