only ping lokid if a service node

pull/1020/head
Jeff Becker 5 years ago
parent 9214ecbc48
commit e5f92eaa79
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -131,6 +131,9 @@ namespace llarp
virtual bool virtual bool
Configure(Config *conf, llarp_nodedb *nodedb) = 0; Configure(Config *conf, llarp_nodedb *nodedb) = 0;
virtual bool
IsServiceNode() const = 0;
virtual bool virtual bool
StartJsonRpc() = 0; StartJsonRpc() = 0;

@ -323,7 +323,7 @@ namespace llarp
/// return true if we are running in service node mode /// return true if we are running in service node mode
bool bool
IsServiceNode() const; IsServiceNode() const override;
void void
Close(); Close();

@ -181,10 +181,13 @@ namespace llarp
AsyncUpdatePubkeyList(); AsyncUpdatePubkeyList();
m_NextKeyUpdate = now + KeyUpdateInterval; m_NextKeyUpdate = now + KeyUpdateInterval;
} }
if(now >= m_NextPing) if(router->IsServiceNode())
{ {
AsyncLokiPing(); if(now >= m_NextPing)
m_NextPing = now + PingInterval; {
AsyncLokiPing();
m_NextPing = now + PingInterval;
}
} }
Flush(); Flush();
} }

Loading…
Cancel
Save