mirror of
https://github.com/SChernykh/p2pool.git
synced 2024-11-17 08:17:55 +00:00
Disable cmd params depending on compile flags
This commit is contained in:
parent
634039e551
commit
d4a57370ef
2 changed files with 8 additions and 0 deletions
|
@ -100,10 +100,12 @@ Params::Params(int argc, char* argv[])
|
||||||
ok = true;
|
ok = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WITH_RANDOMX
|
||||||
if (strcmp(argv[i], "--no-randomx") == 0) {
|
if (strcmp(argv[i], "--no-randomx") == 0) {
|
||||||
m_disableRandomX = true;
|
m_disableRandomX = true;
|
||||||
ok = true;
|
ok = true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if ((!strcmp(argv[i], "--out-peers") || !strcmp(argv[i], "--outpeers")) && (i + 1 < argc)) {
|
if ((!strcmp(argv[i], "--out-peers") || !strcmp(argv[i], "--outpeers")) && (i + 1 < argc)) {
|
||||||
m_maxOutgoingPeers = std::min(std::max(strtoul(argv[++i], nullptr, 10), 10UL), 450UL);
|
m_maxOutgoingPeers = std::min(std::max(strtoul(argv[++i], nullptr, 10), 10UL), 450UL);
|
||||||
|
@ -151,10 +153,12 @@ Params::Params(int argc, char* argv[])
|
||||||
ok = true;
|
ok = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WITH_UPNP
|
||||||
if (strcmp(argv[i], "--no-upnp") == 0) {
|
if (strcmp(argv[i], "--no-upnp") == 0) {
|
||||||
m_upnp = false;
|
m_upnp = false;
|
||||||
ok = true;
|
ok = true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
fprintf(stderr, "Unknown command line parameter %s\n\n", argv[i]);
|
fprintf(stderr, "Unknown command line parameter %s\n\n", argv[i]);
|
||||||
|
|
|
@ -53,7 +53,11 @@ struct Params
|
||||||
std::string m_socks5Proxy;
|
std::string m_socks5Proxy;
|
||||||
bool m_dns = true;
|
bool m_dns = true;
|
||||||
uint32_t m_p2pExternalPort = 0;
|
uint32_t m_p2pExternalPort = 0;
|
||||||
|
#ifdef WITH_UPNP
|
||||||
bool m_upnp = true;
|
bool m_upnp = true;
|
||||||
|
#else
|
||||||
|
bool m_upnp = false;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace p2pool
|
} // namespace p2pool
|
||||||
|
|
Loading…
Reference in a new issue