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