mirror of
https://github.com/SChernykh/p2pool.git
synced 2025-01-05 10:19:23 +00:00
Tweaked idle peer detection
This commit is contained in:
parent
ee7a1e54f7
commit
52f195b89f
1 changed files with 1 additions and 1 deletions
|
@ -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)) {
|
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);
|
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) {
|
if (cur_time >= client->m_lastAlive + timeout) {
|
||||||
const uint64_t idle_time = static_cast<uint64_t>(cur_time - client->m_lastAlive);
|
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");
|
LOGWARN(5, "peer " << static_cast<char*>(client->m_addrString) << " has been idle for " << idle_time << " seconds, disconnecting");
|
||||||
|
|
Loading…
Reference in a new issue