Added --p2p-external-port command line parameter

This commit is contained in:
SChernykh
2022-10-28 14:06:26 +02:00
parent 6eacb677a4
commit 65a9574e52
7 changed files with 19 additions and 3 deletions
+7 -2
View File
@@ -35,12 +35,12 @@ Params::Params(int argc, char* argv[])
}
if ((strcmp(argv[i], "--rpc-port") == 0) && (i + 1 < argc)) {
m_rpcPort = strtoul(argv[++i], nullptr, 10);
m_rpcPort = std::min(std::max(strtoul(argv[++i], nullptr, 10), 1UL), 65535UL);
ok = true;
}
if ((strcmp(argv[i], "--zmq-port") == 0) && (i + 1 < argc)) {
m_zmqPort = strtoul(argv[++i], nullptr, 10);
m_zmqPort = std::min(std::max(strtoul(argv[++i], nullptr, 10), 1UL), 65535UL);
ok = true;
}
@@ -146,6 +146,11 @@ Params::Params(int argc, char* argv[])
ok = true;
}
if ((strcmp(argv[i], "--p2p-external-port") == 0) && (i + 1 < argc)) {
m_p2pExternalPort = std::min(std::max(strtoul(argv[++i], nullptr, 10), 1UL), 65535UL);
ok = true;
}
if (!ok) {
fprintf(stderr, "Unknown command line parameter %s\n\n", argv[i]);
p2pool_usage();