aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_utilities/blockchain_usage.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/blockchain_utilities/blockchain_usage.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/blockchain_utilities/blockchain_usage.cpp b/src/blockchain_utilities/blockchain_usage.cpp
index a5228eb92..d2ecf2abf 100644
--- a/src/blockchain_utilities/blockchain_usage.cpp
+++ b/src/blockchain_utilities/blockchain_usage.cpp
@@ -35,6 +35,7 @@
#include "cryptonote_core/cryptonote_core.h"
#include "cryptonote_core/blockchain.h"
#include "blockchain_db/blockchain_db.h"
+#include "blockchain_and_pool.h"
#include "version.h"
#undef MONERO_DEFAULT_LOG_CATEGORY
@@ -151,9 +152,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 +174,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 +185,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)