From b52abd1370cc21484d64f45504adbab47240debf Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sun, 14 May 2017 14:06:55 +0100 Subject: Move txpool to the database Integration could go further (ie, return_tx_to_pool calls should not be needed anymore, possibly other things). poolstate.bin is now obsolete. --- src/blockchain_utilities/blockchain_import.cpp | 2 +- src/blockchain_utilities/fake_core.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/blockchain_utilities') diff --git a/src/blockchain_utilities/blockchain_import.cpp b/src/blockchain_utilities/blockchain_import.cpp index b2c217ca1..a43e2b4ad 100644 --- a/src/blockchain_utilities/blockchain_import.cpp +++ b/src/blockchain_utilities/blockchain_import.cpp @@ -443,7 +443,7 @@ int import_from_file(FakeCore& simple_core, const std::string& import_file_path, // tx number 1: coinbase tx // tx number 2 onwards: archived_txs unsigned int tx_num = 1; - for (const transaction& tx : archived_txs) + for (transaction tx : archived_txs) { ++tx_num; // if tx is invalid diff --git a/src/blockchain_utilities/fake_core.h b/src/blockchain_utilities/fake_core.h index 70144184b..809c6fe43 100644 --- a/src/blockchain_utilities/fake_core.h +++ b/src/blockchain_utilities/fake_core.h @@ -59,8 +59,6 @@ struct fake_core_db // for multi_db_runtime: fake_core_db(const boost::filesystem::path &path, const bool use_testnet=false, const bool do_batch=true, const std::string& db_type="lmdb", const int db_flags=0) : m_pool(m_storage), m_storage(m_pool) { - m_pool.init(path.string()); - BlockchainDB* db = nullptr; if (db_type == "lmdb") db = new BlockchainLMDB(); @@ -98,6 +96,8 @@ struct fake_core_db m_storage.init(db, m_hardfork, use_testnet); + m_pool.init(); + if (do_batch) m_storage.get_db().set_batch_transactions(do_batch); support_batch = true; -- cgit v1.2.3