Limit max in/out peers to 450

To avoid hitting default open files limit (1024)
This commit is contained in:
SChernykh
2022-09-20 10:39:55 +02:00
parent 3022588e35
commit 38a6d3e549
5 changed files with 9 additions and 9 deletions

View File

@@ -106,12 +106,12 @@ Params::Params(int argc, char* argv[])
}
if ((strcmp(argv[i], "--out-peers") == 0) && (i + 1 < argc)) {
m_maxOutgoingPeers = std::min(std::max(strtoul(argv[++i], nullptr, 10), 10UL), 1000UL);
m_maxOutgoingPeers = std::min(std::max(strtoul(argv[++i], nullptr, 10), 10UL), 450UL);
ok = true;
}
if ((strcmp(argv[i], "--in-peers") == 0) && (i + 1 < argc)) {
m_maxIncomingPeers = std::min(std::max(strtoul(argv[++i], nullptr, 10), 10UL), 1000UL);
m_maxIncomingPeers = std::min(std::max(strtoul(argv[++i], nullptr, 10), 10UL), 450UL);
ok = true;
}