aboutsummaryrefslogtreecommitdiff
path: root/src/p2p/net_node.cpp
diff options
context:
space:
mode:
authorwhythat <whythat@protonmail.com>2018-01-22 03:49:51 +0200
committerwhythat <whythat@protonmail.com>2018-02-16 22:32:01 +0200
commitb3b2d4d20cc3c3cf3206468e66f2590c3aed948a (patch)
tree07973a209c847d78f6f574437bf69b058ddce241 /src/p2p/net_node.cpp
parentcommon: implement dynamic option dependencies mechanism (diff)
downloadmonero-b3b2d4d20cc3c3cf3206468e66f2590c3aed948a.tar.xz
options: add testnet option dependencies
Diffstat (limited to '')
-rw-r--r--src/p2p/net_node.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/p2p/net_node.cpp b/src/p2p/net_node.cpp
index 21a7fb50c..170b79984 100644
--- a/src/p2p/net_node.cpp
+++ b/src/p2p/net_node.cpp
@@ -37,9 +37,13 @@ namespace nodetool
const command_line::arg_descriptor<std::string, false, true> arg_p2p_bind_port = {
"p2p-bind-port"
, "Port for p2p network protocol"
- , cryptonote::arg_testnet_on
- , std::to_string(config::testnet::P2P_DEFAULT_PORT)
, std::to_string(config::P2P_DEFAULT_PORT)
+ , cryptonote::arg_testnet_on
+ , [](bool testnet, bool defaulted, std::string val) {
+ if (testnet && defaulted)
+ return std::to_string(config::testnet::P2P_DEFAULT_PORT);
+ return val;
+ }
};
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"};