From 7006b2ebe1c79168fa531cda31ab802fad69d316 Mon Sep 17 00:00:00 2001 From: warptangent Date: Thu, 4 Feb 2016 23:20:48 -0800 Subject: [PATCH] blockchain_utilities: Have fake_core create HardFork object The HardFork object is needed for the importer to update the hard fork data when verify mode is off. --- src/blockchain_utilities/fake_core.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/blockchain_utilities/fake_core.h b/src/blockchain_utilities/fake_core.h index 4b8c2890..29f34026 100644 --- a/src/blockchain_utilities/fake_core.h +++ b/src/blockchain_utilities/fake_core.h @@ -36,12 +36,21 @@ using namespace cryptonote; +namespace +{ + // NOTE: These values should match blockchain.cpp + // TODO: Refactor + const uint64_t mainnet_hard_fork_version_1_till = 1009826; + const uint64_t testnet_hard_fork_version_1_till = 624633; +} + #if !defined(BLOCKCHAIN_DB) || BLOCKCHAIN_DB == DB_LMDB struct fake_core_lmdb { Blockchain m_storage; + HardFork* m_hardfork = nullptr; tx_memory_pool m_pool; bool support_batch; bool support_add_block; @@ -77,7 +86,10 @@ struct fake_core_lmdb db->check_hard_fork_info(); - m_storage.init(db, use_testnet); + uint64_t hard_fork_version_1_till = use_testnet ? testnet_hard_fork_version_1_till : mainnet_hard_fork_version_1_till; + m_hardfork = new HardFork(*db, 1, hard_fork_version_1_till); + + m_storage.init(db, m_hardfork, use_testnet); if (do_batch) m_storage.get_db().set_batch_transactions(do_batch);