From 6e6eab17634908895b65ea95c83ec04b49c44fc1 Mon Sep 17 00:00:00 2001 From: HashVault Date: Tue, 20 Jan 2026 14:39:06 +0300 Subject: [PATCH] Fix keepalive timer logic - Reset timer on send instead of receive (pool needs to know we're alive) - Remove timer disable after first ping to enable continuous keepalives --- src/base/net/stratum/Client.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/base/net/stratum/Client.cpp b/src/base/net/stratum/Client.cpp index b412a543a..6963e9526 100644 --- a/src/base/net/stratum/Client.cpp +++ b/src/base/net/stratum/Client.cpp @@ -554,6 +554,7 @@ int64_t xmrig::Client::send(size_t size) } m_expire = Chrono::steadyMSecs() + kResponseTimeout; + startTimeout(); return m_sequence++; } @@ -661,8 +662,6 @@ void xmrig::Client::onClose() void xmrig::Client::parse(char *line, size_t len) { - startTimeout(); - LOG_DEBUG("[%s] received (%d bytes): \"%.*s\"", url(), len, static_cast(len), line); if (len < 22 || line[0] != '{') { @@ -857,8 +856,6 @@ void xmrig::Client::parseResponse(int64_t id, const rapidjson::Value &result, co void xmrig::Client::ping() { send(snprintf(m_sendBuf.data(), m_sendBuf.size(), "{\"id\":%" PRId64 ",\"jsonrpc\":\"2.0\",\"method\":\"keepalived\",\"params\":{\"id\":\"%s\"}}\n", m_sequence, m_rpcId.data())); - - m_keepAlive = 0; }