diff options
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r-- | src/cryptonote_core/cryptonote_core.cpp | 37 | ||||
-rw-r--r-- | src/cryptonote_core/cryptonote_core.h | 3 | ||||
-rw-r--r-- | src/cryptonote_core/tx_pool.cpp | 4 |
3 files changed, 26 insertions, 18 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index aaa5ccdbc..e0430a18a 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -66,19 +66,22 @@ DISABLE_VS_WARNINGS(4355) namespace cryptonote { - const command_line::arg_descriptor<std::string> arg_data_dir = { - "data-dir" - , "Specify data directory" - }; - const command_line::arg_descriptor<std::string> arg_testnet_data_dir = { - "testnet-data-dir" - , "Specify testnet data directory" - }; const command_line::arg_descriptor<bool, false> arg_testnet_on = { "testnet" , "Run on testnet. The wallet must be launched with --testnet flag." , false }; + const command_line::arg_descriptor<std::string, false, true> arg_data_dir = { + "data-dir" + , "Specify data directory" + , tools::get_default_data_dir() + , arg_testnet_on + , [](bool testnet, bool defaulted, std::string val) { + if (testnet) + return (boost::filesystem::path(val) / "testnet").string(); + return val; + } + }; const command_line::arg_descriptor<bool> arg_offline = { "offline" , "Do not listen for peers, nor connect to any" @@ -134,7 +137,12 @@ namespace cryptonote }; static const command_line::arg_descriptor<bool> arg_fluffy_blocks = { "fluffy-blocks" - , "Relay blocks as fluffy blocks where possible (automatic on testnet)" + , "Relay blocks as fluffy blocks (obsolete, now default)" + , true + }; + static const command_line::arg_descriptor<bool> arg_no_fluffy_blocks = { + "no-fluffy-blocks" + , "Relay blocks as normal blocks" , false }; static const command_line::arg_descriptor<size_t> arg_max_txpool_size = { @@ -229,8 +237,7 @@ namespace cryptonote //----------------------------------------------------------------------------------- void core::init_options(boost::program_options::options_description& desc) { - command_line::add_arg(desc, arg_data_dir, tools::get_default_data_dir()); - command_line::add_arg(desc, arg_testnet_data_dir, (boost::filesystem::path(tools::get_default_data_dir()) / "testnet").string()); + command_line::add_arg(desc, arg_data_dir); command_line::add_arg(desc, arg_test_drop_download); command_line::add_arg(desc, arg_test_drop_download_height); @@ -243,6 +250,7 @@ namespace cryptonote command_line::add_arg(desc, arg_block_sync_size); command_line::add_arg(desc, arg_check_updates); command_line::add_arg(desc, arg_fluffy_blocks); + command_line::add_arg(desc, arg_no_fluffy_blocks); 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); @@ -256,8 +264,7 @@ namespace cryptonote { m_testnet = command_line::get_arg(vm, arg_testnet_on); - auto data_dir_arg = m_testnet ? arg_testnet_data_dir : arg_data_dir; - m_config_folder = command_line::get_arg(vm, data_dir_arg); + m_config_folder = command_line::get_arg(vm, arg_data_dir); auto data_dir = boost::filesystem::path(m_config_folder); @@ -279,9 +286,11 @@ namespace cryptonote set_enforce_dns_checkpoints(command_line::get_arg(vm, arg_dns_checkpoints)); test_drop_download_height(command_line::get_arg(vm, arg_test_drop_download_height)); - m_fluffy_blocks_enabled = m_testnet || get_arg(vm, arg_fluffy_blocks); + m_fluffy_blocks_enabled = !get_arg(vm, arg_no_fluffy_blocks); m_offline = get_arg(vm, arg_offline); m_disable_dns_checkpoints = get_arg(vm, arg_disable_dns_checkpoints); + if (!command_line::is_arg_defaulted(vm, arg_fluffy_blocks)) + MWARNING(arg_fluffy_blocks.name << " is obsolete, it is now default"); if (command_line::get_arg(vm, arg_test_drop_download) == true) test_drop_download(); diff --git a/src/cryptonote_core/cryptonote_core.h b/src/cryptonote_core/cryptonote_core.h index 429f6b820..ce39aaddf 100644 --- a/src/cryptonote_core/cryptonote_core.h +++ b/src/cryptonote_core/cryptonote_core.h @@ -58,8 +58,7 @@ namespace cryptonote const std::pair<uint8_t, uint64_t> *hard_forks; }; - extern const command_line::arg_descriptor<std::string> arg_data_dir; - extern const command_line::arg_descriptor<std::string> arg_testnet_data_dir; + extern const command_line::arg_descriptor<std::string, false, true> arg_data_dir; extern const command_line::arg_descriptor<bool, false> arg_testnet_on; extern const command_line::arg_descriptor<bool> arg_offline; diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index 5f54e93f1..762feb5ee 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -181,7 +181,7 @@ namespace cryptonote } size_t tx_size_limit = get_transaction_size_limit(version); - if (!kept_by_block && blob_size >= tx_size_limit) + if (!kept_by_block && blob_size > tx_size_limit) { LOG_PRINT_L1("transaction is too big: " << blob_size << " bytes, maximum size: " << tx_size_limit); tvc.m_verifivation_failed = true; @@ -1207,7 +1207,7 @@ namespace cryptonote m_txpool_size = 0; m_blockchain.for_all_txpool_txes([this, &remove, tx_size_limit](const crypto::hash &txid, const txpool_tx_meta_t &meta, const cryptonote::blobdata*) { m_txpool_size += meta.blob_size; - if (meta.blob_size >= tx_size_limit) { + if (meta.blob_size > tx_size_limit) { LOG_PRINT_L1("Transaction " << txid << " is too big (" << meta.blob_size << " bytes), removing it from pool"); remove.insert(txid); } |