From 3b1d7e03fcc1caa8898ced33e127f6ba09d66df8 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Fri, 29 Jan 2016 15:09:17 +0000 Subject: Fix V1/V2 use of hard fork related parameters Some of it uses hardcoded height, which will need some thinking for next (voted upon) fork. --- src/cryptonote_core/cryptonote_core.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/cryptonote_core/cryptonote_core.cpp') diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index 608abea19..ac0be5a07 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -358,6 +358,10 @@ namespace cryptonote r = m_blockchain_storage.init(db, m_testnet, m_fakechain); + // now that we have a valid m_blockchain_storage, we can clean out any + // transactions in the pool that do not conform to the current fork + m_mempool.validate(m_blockchain_storage.get_current_hard_fork_version()); + bool show_time_stats = command_line::get_arg(vm, command_line::arg_show_time_stats) != 0; m_blockchain_storage.set_show_time_stats(show_time_stats); #else @@ -607,7 +611,8 @@ namespace cryptonote return true; } - return m_mempool.add_tx(tx, tx_hash, blob_size, tvc, keeped_by_block, relayed); + uint8_t version = m_blockchain_storage.get_current_hard_fork_version(); + return m_mempool.add_tx(tx, tx_hash, blob_size, tvc, keeped_by_block, relayed, version); } //----------------------------------------------------------------------------------------------- bool core::relay_txpool_transactions() -- cgit v1.2.3