aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/cryptonote_core.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-01-29 21:20:24 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-02-07 13:42:12 +0000
commitbc61ae69bfb20d2bdfa3d3716691e316bdbb6cb5 (patch)
tree99d8c5284cfbeda4f957c1c6381a8234cb0efcde /src/cryptonote_core/cryptonote_core.cpp
parent3b4e6b35b36bef8c70f9c1ee0443096b422e9170 (diff)
downloadmonzero-core-bc61ae69bfb20d2bdfa3d3716691e316bdbb6cb5.tar.gz
monzero-core-bc61ae69bfb20d2bdfa3d3716691e316bdbb6cb5.tar.xz
monzero-core-bc61ae69bfb20d2bdfa3d3716691e316bdbb6cb5.zip
tx_pool: add a max pool size, settable with --max-txpool-size
Diffstat (limited to 'src/cryptonote_core/cryptonote_core.cpp')
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index 81a7b4724..aaa5ccdbc 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -137,6 +137,11 @@ namespace cryptonote
, "Relay blocks as fluffy blocks where possible (automatic on testnet)"
, false
};
+ static const command_line::arg_descriptor<size_t> arg_max_txpool_size = {
+ "max-txpool-size"
+ , "Set maximum txpool size in bytes."
+ , DEFAULT_TXPOOL_MAX_SIZE
+ };
//-----------------------------------------------------------------------------------------------
core::core(i_cryptonote_protocol* pprotocol):
@@ -241,6 +246,7 @@ namespace cryptonote
command_line::add_arg(desc, arg_test_dbg_lock_sleep);
command_line::add_arg(desc, arg_offline);
command_line::add_arg(desc, arg_disable_dns_checkpoints);
+ command_line::add_arg(desc, arg_max_txpool_size);
miner::init_options(desc);
BlockchainDB::init_options(desc);
@@ -359,6 +365,7 @@ namespace cryptonote
bool fast_sync = command_line::get_arg(vm, arg_fast_block_sync) != 0;
uint64_t blocks_threads = command_line::get_arg(vm, arg_prep_blocks_threads);
std::string check_updates_string = command_line::get_arg(vm, arg_check_updates);
+ size_t max_txpool_size = command_line::get_arg(vm, arg_max_txpool_size);
boost::filesystem::path folder(m_config_folder);
if (m_fakechain)
@@ -477,7 +484,7 @@ namespace cryptonote
r = m_blockchain_storage.init(db.release(), m_testnet, m_offline, test_options);
- r = m_mempool.init();
+ r = m_mempool.init(max_txpool_size);
CHECK_AND_ASSERT_MES(r, false, "Failed to initialize memory pool");
// now that we have a valid m_blockchain_storage, we can clean out any