diff options
Diffstat (limited to '')
-rw-r--r-- | src/p2p/net_node.cpp | 9 | ||||
-rw-r--r-- | src/p2p/net_node.h | 3 | ||||
-rw-r--r-- | src/p2p/net_node.inl | 10 |
3 files changed, 6 insertions, 16 deletions
diff --git a/src/p2p/net_node.cpp b/src/p2p/net_node.cpp index 994941168..21a7fb50c 100644 --- a/src/p2p/net_node.cpp +++ b/src/p2p/net_node.cpp @@ -34,15 +34,12 @@ namespace nodetool { const command_line::arg_descriptor<std::string> arg_p2p_bind_ip = {"p2p-bind-ip", "Interface for p2p network protocol", "0.0.0.0"}; - const command_line::arg_descriptor<std::string> arg_p2p_bind_port = { + const command_line::arg_descriptor<std::string, false, true> arg_p2p_bind_port = { "p2p-bind-port" , "Port for p2p network protocol" - , std::to_string(config::P2P_DEFAULT_PORT) - }; - const command_line::arg_descriptor<std::string> arg_testnet_p2p_bind_port = { - "testnet-p2p-bind-port" - , "Port for testnet p2p network protocol" + , cryptonote::arg_testnet_on , std::to_string(config::testnet::P2P_DEFAULT_PORT) + , std::to_string(config::P2P_DEFAULT_PORT) }; const command_line::arg_descriptor<uint32_t> arg_p2p_external_port = {"p2p-external-port", "External port for p2p network protocol (if port forwarding used with NAT)", 0}; const command_line::arg_descriptor<bool> arg_p2p_allow_local_ip = {"allow-local-ip", "Allow local ip add to peer list, mostly in debug purposes"}; diff --git a/src/p2p/net_node.h b/src/p2p/net_node.h index 9ebefbca6..54c474665 100644 --- a/src/p2p/net_node.h +++ b/src/p2p/net_node.h @@ -337,8 +337,7 @@ namespace nodetool const int64_t default_limit_up = 2048; const int64_t default_limit_down = 8192; extern const command_line::arg_descriptor<std::string> arg_p2p_bind_ip; - extern const command_line::arg_descriptor<std::string> arg_p2p_bind_port; - extern const command_line::arg_descriptor<std::string> arg_testnet_p2p_bind_port; + extern const command_line::arg_descriptor<std::string, false, true> arg_p2p_bind_port; extern const command_line::arg_descriptor<uint32_t> arg_p2p_external_port; extern const command_line::arg_descriptor<bool> arg_p2p_allow_local_ip; extern const command_line::arg_descriptor<std::vector<std::string> > arg_p2p_add_peer; diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index d60f0a13e..c1de21f22 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -75,7 +75,6 @@ namespace nodetool { command_line::add_arg(desc, arg_p2p_bind_ip); command_line::add_arg(desc, arg_p2p_bind_port, false); - command_line::add_arg(desc, arg_testnet_p2p_bind_port, false); command_line::add_arg(desc, arg_p2p_external_port); command_line::add_arg(desc, arg_p2p_allow_local_ip); command_line::add_arg(desc, arg_p2p_add_peer); @@ -263,12 +262,8 @@ namespace nodetool const boost::program_options::variables_map& vm ) { - m_testnet = command_line::get_arg(vm, cryptonote::arg_testnet_on); - - auto p2p_bind_arg = m_testnet ? arg_testnet_p2p_bind_port : arg_p2p_bind_port; - m_bind_ip = command_line::get_arg(vm, arg_p2p_bind_ip); - m_port = command_line::get_arg(vm, p2p_bind_arg); + m_port = command_line::get_arg(vm, arg_p2p_bind_port); m_external_port = command_line::get_arg(vm, arg_p2p_external_port); m_allow_local_ip = command_line::get_arg(vm, arg_p2p_allow_local_ip); m_no_igd = command_line::get_arg(vm, arg_no_igd); @@ -504,8 +499,7 @@ namespace nodetool } MDEBUG("Number of seed nodes: " << m_seed_nodes.size()); - auto config_arg = m_testnet ? cryptonote::arg_testnet_data_dir : cryptonote::arg_data_dir; - m_config_folder = command_line::get_arg(vm, config_arg); + m_config_folder = command_line::get_arg(vm, cryptonote::arg_data_dir); if ((!m_testnet && m_port != std::to_string(::config::P2P_DEFAULT_PORT)) || (m_testnet && m_port != std::to_string(::config::testnet::P2P_DEFAULT_PORT))) { |