Notify about new P2Pool versions

This commit is contained in:
SChernykh
2023-10-08 18:52:06 +02:00
parent 4d944d3dc3
commit 4e55f53fb4
5 changed files with 44 additions and 1 deletions
+16
View File
@@ -1081,6 +1081,7 @@ void P2PServer::on_timer()
update_peer_connections();
check_host();
check_block_template();
check_for_updates();
api_update_local_stats();
}
@@ -1255,6 +1256,21 @@ void P2PServer::check_block_template()
}
}
void P2PServer::check_for_updates() const
{
if (m_timerCounter % (3600 / m_timerInterval) != 0) {
return;
}
const SideChain& s = m_pool->side_chain();
if (s.precalcFinished() && s.p2pool_update_available()) {
LOGINFO(0, log::LightCyan() << "********************************************************************************");
LOGINFO(0, log::LightCyan() << "* An updated P2Pool version is available, visit p2pool.io for more information *");
LOGINFO(0, log::LightCyan() << "********************************************************************************");
}
}
P2PServer::P2PClient::P2PClient()
: Client(m_p2pReadBuf, sizeof(m_p2pReadBuf))
, m_peerId(0)