report block height reported by oxend in systemd status

pull/1624/head
Jeff Becker 3 years ago
parent f955bec5da
commit 554a44c8bf
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -735,7 +735,8 @@ namespace llarp
{
ss << " snode | known/svc/clients: " << nodedb()->NumLoaded() << "/"
<< NumberOfConnectedRouters() << "/" << NumberOfConnectedClients() << " | "
<< pathContext().CurrentTransitPaths() << " active paths";
<< pathContext().CurrentTransitPaths() << " active paths | "
<< "block " << m_lokidRpcClient->BlockHeight();
}
else
{

@ -83,7 +83,17 @@ namespace llarp
" parts instead of 2 parts so we will not update the list of service nodes");
return; // bail
}
LogDebug("new block at hieght ", msg.data[0]);
try
{
m_BlockHeight = std::stoll(std::string{msg.data[0]});
}
catch (std::exception& ex)
{
LogError("bad block hieght: ", ex.what());
return; // bail
}
LogDebug("new block at hieght ", m_BlockHeight);
// don't upadate on block notification if an update is pending
if (not m_UpdatingList)
UpdateServiceNodeList(std::string{msg.data[1]});

@ -30,6 +30,13 @@ namespace llarp
SecretKey
ObtainIdentityKey();
/// get what the current block height is according to oxend
uint64_t
BlockHeight() const
{
return m_BlockHeight;
}
void
LookupLNSNameHash(
dht::Key_t namehash,
@ -77,6 +84,8 @@ namespace llarp
AbstractRouter* const m_Router;
std::atomic<bool> m_UpdatingList;
uint64_t m_BlockHeight;
};
} // namespace rpc

Loading…
Cancel
Save