aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_utilities/blockchain_depth.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/blockchain_utilities/blockchain_depth.cpp')
-rw-r--r--src/blockchain_utilities/blockchain_depth.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/blockchain_utilities/blockchain_depth.cpp b/src/blockchain_utilities/blockchain_depth.cpp
index 6a06e0a96..f49211233 100644
--- a/src/blockchain_utilities/blockchain_depth.cpp
+++ b/src/blockchain_utilities/blockchain_depth.cpp
@@ -31,10 +31,7 @@
#include <boost/algorithm/string.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
@@ -129,16 +126,8 @@ int main(int argc, char* argv[])
// Use Blockchain instead of lower-level BlockchainDB for two reasons:
// 1. Blockchain has the init() method for easy setup
// 2. exporter needs to use get_current_blockchain_height(), get_block_id_by_height(), get_block_by_hash()
- //
- // cannot match blockchain_storage setup above with just one line,
- // e.g.
- // Blockchain* core_storage = new Blockchain(NULL);
- // because unlike blockchain_storage constructor, which takes a pointer to
- // tx_memory_pool, Blockchain's constructor takes tx_memory_pool object.
LOG_PRINT_L0("Initializing source blockchain (BlockchainDB)");
- 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)
{
@@ -159,7 +148,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");
@@ -327,7 +316,7 @@ done:
LOG_PRINT_L0("Average min depth for " << start_txids.size() << " transaction(s): " << cumulative_depth/(float)depths.size());
LOG_PRINT_L0("Median min depth for " << start_txids.size() << " transaction(s): " << epee::misc_utils::median(depths));
- core_storage->deinit();
+ core_storage->blockchain.deinit();
return 0;
CATCH_ENTRY("Depth query error", 1);