Merge pull request #365 from Low-power/update-stratum-hashrate-data-without-connected-workers
Hash rate values in `local/stratum` API file stuck after all workers disconnected
This commit is contained in:
@@ -113,6 +113,7 @@ void StratumServer::on_block(const BlockTemplate& block)
|
|||||||
const uint32_t num_connections = m_numConnections;
|
const uint32_t num_connections = m_numConnections;
|
||||||
if (num_connections == 0) {
|
if (num_connections == 0) {
|
||||||
LOGINFO(4, "no clients connected");
|
LOGINFO(4, "no clients connected");
|
||||||
|
update_hashrate_data(0, seconds_since_epoch());
|
||||||
api_update_local_stats(seconds_since_epoch());
|
api_update_local_stats(seconds_since_epoch());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -186,6 +187,7 @@ void StratumServer::on_block(const BlockTemplate& block)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
update_hashrate_data(0, seconds_since_epoch());
|
||||||
api_update_local_stats(seconds_since_epoch());
|
api_update_local_stats(seconds_since_epoch());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user