aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_utilities/blockchain_usage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/blockchain_utilities/blockchain_usage.cpp')
-rw-r--r--src/blockchain_utilities/blockchain_usage.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/blockchain_utilities/blockchain_usage.cpp b/src/blockchain_utilities/blockchain_usage.cpp
index a5228eb92..0b9686765 100644
--- a/src/blockchain_utilities/blockchain_usage.cpp
+++ b/src/blockchain_utilities/blockchain_usage.cpp
@@ -31,10 +31,7 @@
#include <boost/filesystem/path.hpp>
#include "common/command_line.h"
#include "common/varint.h"
-#include "cryptonote_core/tx_pool.h"
#include "cryptonote_core/cryptonote_core.h"
-#include "cryptonote_core/blockchain.h"
-#include "blockchain_db/blockchain_db.h"
#include "version.h"
#undef MONERO_DEFAULT_LOG_CATEGORY
@@ -151,9 +148,8 @@ int main(int argc, char* argv[])
// tx_memory_pool, Blockchain's constructor takes tx_memory_pool object.
LOG_PRINT_L0("Initializing source blockchain (BlockchainDB)");
const std::string input = command_line::get_arg(vm, arg_input);
- std::unique_ptr<Blockchain> core_storage;
- tx_memory_pool m_mempool(*core_storage);
- core_storage.reset(new Blockchain(m_mempool));
+ std::unique_ptr<BlockchainAndPool> core_storage = std::make_unique<BlockchainAndPool>();
+
BlockchainDB* db = new_db();
if (db == NULL)
{
@@ -174,7 +170,7 @@ int main(int argc, char* argv[])
LOG_PRINT_L0("Error opening database: " << e.what());
return 1;
}
- r = core_storage->init(db, net_type);
+ r = core_storage->blockchain.init(db, net_type);
CHECK_AND_ASSERT_MES(r, 1, "Failed to initialize source blockchain storage");
LOG_PRINT_L0("Source blockchain storage initialized OK");
@@ -185,10 +181,10 @@ int main(int argc, char* argv[])
std::unordered_map<uint64_t,uint64_t> indices;
LOG_PRINT_L0("Reading blockchain from " << input);
- core_storage->for_all_transactions([&](const crypto::hash &hash, const cryptonote::transaction &tx)->bool
+ core_storage->blockchain.for_all_transactions([&](const crypto::hash &hash, const cryptonote::transaction &tx)->bool
{
const bool coinbase = tx.vin.size() == 1 && tx.vin[0].type() == typeid(txin_gen);
- const uint64_t height = core_storage->get_db().get_tx_block_height(hash);
+ const uint64_t height = core_storage->blockchain.get_db().get_tx_block_height(hash);
// create new outputs
for (const auto &out: tx.vout)