From 768ed30c057d01238ea87e1a7111f5d1882a25a3 Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 13 Apr 2022 22:49:24 -0400 Subject: [PATCH] add public key in rpc ping --- llarp/rpc/lokid_rpc_client.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/llarp/rpc/lokid_rpc_client.cpp b/llarp/rpc/lokid_rpc_client.cpp index 0fc6ddb7b..44e5c9520 100644 --- a/llarp/rpc/lokid_rpc_client.cpp +++ b/llarp/rpc/lokid_rpc_client.cpp @@ -7,6 +7,7 @@ #include #include +#include #include namespace llarp @@ -147,7 +148,12 @@ namespace llarp constexpr auto PingInterval = 30s; auto makePingRequest = [self = shared_from_this()]() { // send a ping - nlohmann::json payload = {{"version", {VERSION[0], VERSION[1], VERSION[2]}}}; + PubKey pk{}; + if (auto r = self->m_Router.lock()) + pk = r->pubkey(); + nlohmann::json payload = { + {"pubkey_ed25519", oxenc::to_hex(pk.begin(), pk.end())}, + {"version", {VERSION[0], VERSION[1], VERSION[2]}}}; self->Request( "admin.lokinet_ping", [](bool success, std::vector data) {