Tweaked idle peer detection

pull/22/head
SChernykh 3 years ago
parent ee7a1e54f7
commit 52f195b89f

@ -175,7 +175,7 @@ void P2PServer::update_peer_connections()
for (P2PClient* client = static_cast<P2PClient*>(m_connectedClientsList->m_next); client != m_connectedClientsList; client = static_cast<P2PClient*>(client->m_next)) {
connected_clients.emplace_back(client->m_addr);
const int timeout = client->m_handshakeComplete ? 300 : 5;
const int timeout = client->m_handshakeComplete ? 300 : 10;
if (cur_time >= client->m_lastAlive + timeout) {
const uint64_t idle_time = static_cast<uint64_t>(cur_time - client->m_lastAlive);
LOGWARN(5, "peer " << static_cast<char*>(client->m_addrString) << " has been idle for " << idle_time << " seconds, disconnecting");

Loading…
Cancel
Save