Merge pull request #1893 from majestrate/issue-1892-rpc-ping-pubkey-2022-04-13

add public key in rpc ping
pull/1896/head
majestrate 2 years ago committed by GitHub
commit 293bccb6d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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) {

Loading…
Cancel
Save