diff options
author | warptangent <warptangent@tutanota.com> | 2016-02-04 23:20:48 -0800 |
---|---|---|
committer | warptangent <warptangent@tutanota.com> | 2016-02-08 08:50:53 -0800 |
commit | 7006b2ebe1c79168fa531cda31ab802fad69d316 (patch) | |
tree | c2135e6fcc68c9862696445d8b72596dccbc23b5 /src | |
parent | Blockchain: Optionally pass in HardFork object (diff) | |
download | monero-7006b2ebe1c79168fa531cda31ab802fad69d316.tar.xz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/blockchain_utilities/fake_core.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/blockchain_utilities/fake_core.h b/src/blockchain_utilities/fake_core.h index 4b8c28902..29f34026d 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); |