ping oxend after getting identity keys

fixes #2125
pull/2128/head
Jeff Becker 1 year ago
parent 7ae1a1a83b
commit 031e173f1a
No known key found for this signature in database
GPG Key ID: 025C02EE3A092F2D

@ -361,6 +361,7 @@ namespace llarp
_identity = RpcClient()->ObtainIdentityKey(); _identity = RpcClient()->ObtainIdentityKey();
const RouterID pk{pubkey()}; const RouterID pk{pubkey()};
LogWarn("Obtained lokid identity key: ", pk); LogWarn("Obtained lokid identity key: ", pk);
RpcClient()->StartPings();
break; break;
} }
catch (const std::exception& e) catch (const std::exception& e)

@ -64,7 +64,7 @@ namespace llarp
LogInfo("connecting to lokid via LMQ at ", url.full_address()); LogInfo("connecting to lokid via LMQ at ", url.full_address());
m_Connection = m_lokiMQ->connect_remote( m_Connection = m_lokiMQ->connect_remote(
url, url,
[self = shared_from_this()](oxenmq::ConnectionID) { self->Connected(); }, [](oxenmq::ConnectionID) {},
[self = shared_from_this(), url](oxenmq::ConnectionID, std::string_view f) { [self = shared_from_this(), url](oxenmq::ConnectionID, std::string_view f) {
llarp::LogWarn("Failed to connect to lokid: ", f); llarp::LogWarn("Failed to connect to lokid: ", f);
if (auto router = self->m_Router.lock()) if (auto router = self->m_Router.lock())
@ -168,7 +168,7 @@ namespace llarp
} }
void void
LokidRpcClient::Connected() LokidRpcClient::StartPings()
{ {
constexpr auto PingInterval = 30s; constexpr auto PingInterval = 30s;
auto makePingRequest = [self = shared_from_this()]() { auto makePingRequest = [self = shared_from_this()]() {

@ -46,11 +46,10 @@ namespace llarp
void void
InformConnection(RouterID router, bool success); InformConnection(RouterID router, bool success);
private:
/// called when we have connected to lokid via lokimq
void void
Connected(); StartPings();
private:
/// do a lmq command on the current connection /// do a lmq command on the current connection
void void
Command(std::string_view cmd); Command(std::string_view cmd);

Loading…
Cancel
Save