fix keepalive config from being ignored

When a pool reports it supports keepalive, but a client has set
keepalive:false or keepalive:0 in the config, this was ignored and
keepalive was always enabled.
This commit is contained in:
Jethro Grassie 2021-03-19 13:03:13 -04:00
parent 69590f9777
commit 695e1a93a3
No known key found for this signature in database
GPG key ID: DE8ED755616565BB

View file

@ -940,7 +940,7 @@ void xmrig::Client::startTimeout()
{
m_expire = 0;
if (has<EXT_KEEPALIVE>()) {
if (has<EXT_KEEPALIVE>() && m_pool.keepAlive() > 0) {
const uint64_t ms = static_cast<uint64_t>(m_pool.keepAlive() > 0 ? m_pool.keepAlive() : Pool::kKeepAliveTimeout) * 1000;
m_keepAlive = Chrono::steadyMSecs() + ms;