aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
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/rpc
parentcommon: implement dynamic option dependencies mechanism (diff)
downloadmonero-b3b2d4d20cc3c3cf3206468e66f2590c3aed948a.tar.xz
options: add testnet option dependencies
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/core_rpc_server.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index 4eab9b6d9..a8d801ac7 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -2076,9 +2076,13 @@ namespace cryptonote
const command_line::arg_descriptor<std::string, false, true> core_rpc_server::arg_rpc_bind_port = {
"rpc-bind-port"
, "Port for RPC server"
- , cryptonote::arg_testnet_on
- , std::to_string(config::testnet::RPC_DEFAULT_PORT)
, std::to_string(config::RPC_DEFAULT_PORT)
+ , cryptonote::arg_testnet_on
+ , [](bool testnet, bool defaulted, std::string val) {
+ if (testnet && defaulted)
+ return std::to_string(config::testnet::RPC_DEFAULT_PORT);
+ return val;
+ }
};
const command_line::arg_descriptor<std::string> core_rpc_server::arg_rpc_restricted_bind_port = {