add public key in rpc ping

This commit is contained in:
Jeff 2022-04-13 22:49:24 -04:00
parent f702aacc38
commit 768ed30c05
1 changed files with 7 additions and 1 deletions

View File

@ -7,6 +7,7 @@
#include <nlohmann/json.hpp>
#include <oxenc/bt.h>
#include <oxenc/hex.h>
#include <llarp/util/time.hpp>
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<std::string> data) {