diff options
| author | Riccardo Spagni <ric@spagni.net> | 2018-02-17 11:51:57 +0100 |
|---|---|---|
| committer | Riccardo Spagni <ric@spagni.net> | 2018-02-17 11:51:57 +0100 |
| commit | 6198c816b1749dbe55a74084ea65694d8a391046 (patch) | |
| tree | 2fb5dc0857792bea59242950c70f76a006fefee5 /src/p2p/net_node.cpp | |
| parent | a2cbedd29f559adef8c834ab1341f35c2797bd7a (diff) | |
| parent | b3b2d4d20cc3c3cf3206468e66f2590c3aed948a (diff) | |
| download | monzero-core-6198c816b1749dbe55a74084ea65694d8a391046.tar.gz monzero-core-6198c816b1749dbe55a74084ea65694d8a391046.tar.xz monzero-core-6198c816b1749dbe55a74084ea65694d8a391046.zip | |
Merge pull request #3170
b3b2d4d2 options: add testnet option dependencies (whythat)
c5f55bb4 common: implement dynamic option dependencies mechanism (whythat)
05a12ccc options: remove testnet-* options (whythat)
c33cb60e common: implement dependent option descriptor (whythat)
Diffstat (limited to 'src/p2p/net_node.cpp')
| -rw-r--r-- | src/p2p/net_node.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/p2p/net_node.cpp b/src/p2p/net_node.cpp index 994941168..170b79984 100644 --- a/src/p2p/net_node.cpp +++ b/src/p2p/net_node.cpp @@ -34,15 +34,16 @@ 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" - , std::to_string(config::testnet::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"}; |
