Skip to content

Commit

Permalink
Remove useless arguments from the CLI
Browse files Browse the repository at this point in the history
Removes:
 - disable_udp
 - enable_udp
 - disable_tcp_realtime (TCP cannot be disabled anymore)
  • Loading branch information
Thiago Silva authored and thsfs committed Feb 15, 2023
1 parent 10ce90d commit 1865d61
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
15 changes: 0 additions & 15 deletions nano/node/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ std::string nano::error_cli_messages::message (int ev) const
return "Database write error";
case nano::error_cli::reading_config:
return "Config file read error";
case nano::error_cli::disable_all_network:
return "Flags --disable_tcp_realtime and --disable_udp cannot be used together";
case nano::error_cli::ambiguous_udp_options:
return "Flags --disable_udp and --enable_udp cannot be used together";
case nano::error_cli::ambiguous_pruning_voting_options:
return "Flag --enable_pruning and enable_voting in node config cannot be used together";
}
Expand Down Expand Up @@ -101,8 +97,6 @@ void nano::add_node_flag_options (boost::program_options::options_description &
("disable_rep_crawler", "Disable rep crawler")
("disable_request_loop", "Disable request loop")
("disable_bootstrap_listener", "Disables bootstrap processing for TCP listener (not including realtime network TCP connections)")
("disable_tcp_realtime", "Disables TCP realtime network")
("enable_udp", "Enables UDP realtime network")
("disable_unchecked_cleanup", "Disables periodic cleanup of old records from unchecked table")
("disable_unchecked_drop", "Disables drop of unchecked table at startup")
("disable_providing_telemetry_metrics", "Disable using any node information in the telemetry_ack messages.")
Expand Down Expand Up @@ -133,17 +127,8 @@ std::error_code nano::update_flags (nano::node_flags & flags_a, boost::program_o
if (!flags_a.inactive_node)
{
flags_a.disable_bootstrap_listener = (vm.count ("disable_bootstrap_listener") > 0);
flags_a.disable_tcp_realtime = (vm.count ("disable_tcp_realtime") > 0);
}
flags_a.disable_providing_telemetry_metrics = (vm.count ("disable_providing_telemetry_metrics") > 0);
if ((vm.count ("disable_udp") > 0) && (vm.count ("enable_udp") > 0))
{
ec = nano::error_cli::ambiguous_udp_options;
}
if (flags_a.disable_tcp_realtime)
{
ec = nano::error_cli::disable_all_network;
}
flags_a.disable_unchecked_cleanup = (vm.count ("disable_unchecked_cleanup") > 0);
flags_a.disable_unchecked_drop = (vm.count ("disable_unchecked_drop") > 0);
flags_a.disable_block_processor_unchecked_deletion = (vm.count ("disable_block_processor_unchecked_deletion") > 0);
Expand Down
4 changes: 1 addition & 3 deletions nano/node/cli.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ enum class error_cli
unknown_command = 4,
database_write_error = 5,
reading_config = 6,
disable_all_network = 7,
ambiguous_udp_options = 8,
ambiguous_pruning_voting_options = 9
ambiguous_pruning_voting_options = 7
};

void add_node_options (boost::program_options::options_description &);
Expand Down

0 comments on commit 1865d61

Please sign in to comment.