mirror of
https://github.com/SChernykh/p2pool.git
synced 2024-12-31 15:59:27 +00:00
P2PServer: show an error when there are no connections
This commit is contained in:
parent
af2a8eeb08
commit
77a3a5857c
3 changed files with 9 additions and 0 deletions
|
@ -371,6 +371,7 @@ template<> struct log::Stream::Entry<XMRAmount>
|
|||
|
||||
template<> struct log::Stream::Entry<NetworkType>
|
||||
{
|
||||
// cppcheck-suppress constParameter
|
||||
static NOINLINE void put(const NetworkType& value, Stream* wrapper)
|
||||
{
|
||||
switch (value) {
|
||||
|
|
|
@ -49,6 +49,7 @@ P2PServer::P2PServer(p2pool* pool)
|
|||
, m_rng(m_rd())
|
||||
, m_block(new PoolBlock())
|
||||
, m_timer{}
|
||||
, m_timerCounter(0)
|
||||
, m_peerId(m_rng())
|
||||
, m_peerListLastSaved(0)
|
||||
{
|
||||
|
@ -227,6 +228,10 @@ void P2PServer::update_peer_connections()
|
|||
}
|
||||
peer_list.pop_back();
|
||||
}
|
||||
|
||||
if ((m_numConnections == 0) && ((m_timerCounter % 30) == 0)) {
|
||||
LOGERR(1, "no connections to other p2pool nodes, check your monerod/p2pool/network/firewall setup!!!");
|
||||
}
|
||||
}
|
||||
|
||||
void P2PServer::update_peer_list()
|
||||
|
@ -662,6 +667,8 @@ void P2PServer::print_status()
|
|||
|
||||
void P2PServer::on_timer()
|
||||
{
|
||||
++m_timerCounter;
|
||||
|
||||
if (!m_initialPeerList.empty()) {
|
||||
connect_to_peers(m_initialPeerList);
|
||||
m_initialPeerList.clear();
|
||||
|
|
|
@ -156,6 +156,7 @@ private:
|
|||
PoolBlock* m_block;
|
||||
|
||||
uv_timer_t m_timer;
|
||||
uint32_t m_timerCounter;
|
||||
|
||||
uint64_t m_peerId;
|
||||
|
||||
|
|
Loading…
Reference in a new issue