Code cleanup

This commit is contained in:
SChernykh 2023-06-18 16:47:31 +02:00
parent b5fa34e1a1
commit a9a2113ea4
2 changed files with 6 additions and 10 deletions

View file

@ -1596,12 +1596,10 @@ bool p2pool::zmq_running() const
Params::Host p2pool::switch_host()
{
const Params::Host new_host = m_params->m_hosts[++m_currentHostIndex % m_params->m_hosts.size()];
{
WriteLock lock(m_currentHostLock);
m_currentHost = new_host;
}
return new_host;
WriteLock lock(m_currentHostLock);
m_currentHost = m_params->m_hosts[++m_currentHostIndex % m_params->m_hosts.size()];
return m_currentHost;
}
void p2pool::reconnect_to_host()
@ -1620,11 +1618,9 @@ void p2pool::reconnect_to_host()
WriteLock lock(m_ZMQReaderLock);
ZMQReader* old_reader = m_ZMQReader;
delete m_ZMQReader;
m_ZMQReader = nullptr;
delete old_reader;
try {
ZMQReader* new_reader = new ZMQReader(new_host.m_address, new_host.m_zmqPort, m_params->m_socks5Proxy, this);
m_zmqLastActive = seconds_since_epoch();

View file

@ -2068,7 +2068,7 @@ void SideChain::prune_old_blocks()
m_pool->reconnect_to_host();
}
if (m_pool && m_precalcFinished.load() && (cur_time >= m_firstPruneTime + 120)) {
if (cur_time >= m_firstPruneTime + 120) {
LOGINFO(0, log::LightGreen() << "[DEV] Synchronization finished successfully, stopping P2Pool now");
print_status(false);
P2PServer* server = m_pool->p2p_server();