Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/avalanche.cpp
Show First 20 Lines • Show All 426 Lines • ▼ Show 20 Lines | static UniValue getavalanchepeerinfo(const Config &config, | ||||
} | } | ||||
UniValue ret(UniValue::VARR); | UniValue ret(UniValue::VARR); | ||||
for (const auto &peer : g_avalanche->getPeers()) { | for (const auto &peer : g_avalanche->getPeers()) { | ||||
UniValue obj(UniValue::VOBJ); | UniValue obj(UniValue::VOBJ); | ||||
CDataStream serproof(SER_NETWORK, PROTOCOL_VERSION); | CDataStream serproof(SER_NETWORK, PROTOCOL_VERSION); | ||||
serproof << peer.proof; | serproof << *peer.proof; | ||||
obj.pushKV("peerid", uint64_t(peer.peerid)); | obj.pushKV("peerid", uint64_t(peer.peerid)); | ||||
obj.pushKV("proof", HexStr(serproof)); | obj.pushKV("proof", HexStr(serproof)); | ||||
UniValue nodes(UniValue::VARR); | UniValue nodes(UniValue::VARR); | ||||
for (const auto &id : g_avalanche->getNodeIdsForPeer(peer.peerid)) { | for (const auto &id : g_avalanche->getNodeIdsForPeer(peer.peerid)) { | ||||
nodes.push_back(id); | nodes.push_back(id); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |