mirror of
https://github.com/monero-project/monero.git
synced 2025-08-09 01:12:20 -04:00
Merge pull request #9404
f4672c259
cryptonote_core: only verify txpool when the hardfork value has changed. (0xFFFC0000)
This commit is contained in:
commit
d2d976ca5a
1 changed files with 14 additions and 1 deletions
|
@ -31,6 +31,7 @@
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
#include <boost/uuid/nil_generator.hpp>
|
#include <boost/uuid/nil_generator.hpp>
|
||||||
|
|
||||||
|
#include "misc_log_ex.h"
|
||||||
#include "string_tools.h"
|
#include "string_tools.h"
|
||||||
using namespace epee;
|
using namespace epee;
|
||||||
|
|
||||||
|
@ -664,9 +665,21 @@ namespace cryptonote
|
||||||
r = m_mempool.init(max_txpool_weight, m_nettype == FAKECHAIN);
|
r = m_mempool.init(max_txpool_weight, m_nettype == FAKECHAIN);
|
||||||
CHECK_AND_ASSERT_MES(r, false, "Failed to initialize memory pool");
|
CHECK_AND_ASSERT_MES(r, false, "Failed to initialize memory pool");
|
||||||
|
|
||||||
|
uint64_t session_start_height = m_blockchain_storage.get_current_blockchain_height() - 1; // use top block's height
|
||||||
|
uint8_t hardfork_version_start = m_blockchain_storage.get_hard_fork_version(session_start_height);
|
||||||
|
uint8_t hardfork_version_current = m_blockchain_storage.get_current_hard_fork_version();
|
||||||
|
MDEBUG("Current height: " << session_start_height);
|
||||||
|
MDEBUG("Start hardfork version: " << (int) hardfork_version_start);
|
||||||
|
MDEBUG("Current hardfork version: " << (int) hardfork_version_current);
|
||||||
|
|
||||||
// now that we have a valid m_blockchain_storage, we can clean out any
|
// 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
|
// transactions in the pool that do not conform to the current fork
|
||||||
m_mempool.validate(m_blockchain_storage.get_current_hard_fork_version());
|
if(hardfork_version_start != hardfork_version_current) {
|
||||||
|
m_mempool.validate(hardfork_version_current);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
MDEBUG("Not validating the txpool, no hardfork detected.");
|
||||||
|
}
|
||||||
|
|
||||||
bool show_time_stats = command_line::get_arg(vm, arg_show_time_stats) != 0;
|
bool show_time_stats = command_line::get_arg(vm, arg_show_time_stats) != 0;
|
||||||
m_blockchain_storage.set_show_time_stats(show_time_stats);
|
m_blockchain_storage.set_show_time_stats(show_time_stats);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue