Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/net.cpp
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | RPCHelpMan{ | ||||
{{ | {{ | ||||
{RPCResult::Type::NUM, "id", "Peer index"}, | {RPCResult::Type::NUM, "id", "Peer index"}, | ||||
{RPCResult::Type::STR, "addr", | {RPCResult::Type::STR, "addr", | ||||
"(host:port) The IP address and port of the peer"}, | "(host:port) The IP address and port of the peer"}, | ||||
{RPCResult::Type::STR, "addrbind", | {RPCResult::Type::STR, "addrbind", | ||||
"(ip:port) Bind address of the connection to the peer"}, | "(ip:port) Bind address of the connection to the peer"}, | ||||
{RPCResult::Type::STR, "addrlocal", | {RPCResult::Type::STR, "addrlocal", | ||||
"(ip:port) Local address as reported by the peer"}, | "(ip:port) Local address as reported by the peer"}, | ||||
{RPCResult::Type::NUM, "mapped_as", | |||||
"The AS in the BGP route to the peer used for " | |||||
"diversifying peer selection\n"}, | |||||
{RPCResult::Type::STR_HEX, "services", | {RPCResult::Type::STR_HEX, "services", | ||||
"The services offered"}, | "The services offered"}, | ||||
{RPCResult::Type::ARR, | {RPCResult::Type::ARR, | ||||
"servicesnames", | "servicesnames", | ||||
"the services offered, in human-readable form", | "the services offered, in human-readable form", | ||||
{{RPCResult::Type::STR, "SERVICE_NAME", | {{RPCResult::Type::STR, "SERVICE_NAME", | ||||
"the service name if it is recognised"}}}, | "the service name if it is recognised"}}}, | ||||
{RPCResult::Type::BOOL, "relaytxes", | {RPCResult::Type::BOOL, "relaytxes", | ||||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | for (const CNodeStats &stats : vstats) { | ||||
obj.pushKV("id", stats.nodeid); | obj.pushKV("id", stats.nodeid); | ||||
obj.pushKV("addr", stats.addrName); | obj.pushKV("addr", stats.addrName); | ||||
if (!(stats.addrLocal.empty())) { | if (!(stats.addrLocal.empty())) { | ||||
obj.pushKV("addrlocal", stats.addrLocal); | obj.pushKV("addrlocal", stats.addrLocal); | ||||
} | } | ||||
if (stats.addrBind.IsValid()) { | if (stats.addrBind.IsValid()) { | ||||
obj.pushKV("addrbind", stats.addrBind.ToString()); | obj.pushKV("addrbind", stats.addrBind.ToString()); | ||||
} | } | ||||
if (stats.m_mapped_as != 0) { | |||||
obj.pushKV("mapped_as", uint64_t(stats.m_mapped_as)); | |||||
} | |||||
obj.pushKV("services", strprintf("%016x", stats.nServices)); | obj.pushKV("services", strprintf("%016x", stats.nServices)); | ||||
obj.pushKV("servicesnames", GetServicesNames(stats.nServices)); | obj.pushKV("servicesnames", GetServicesNames(stats.nServices)); | ||||
obj.pushKV("relaytxes", stats.fRelayTxes); | obj.pushKV("relaytxes", stats.fRelayTxes); | ||||
obj.pushKV("lastsend", stats.nLastSend); | obj.pushKV("lastsend", stats.nLastSend); | ||||
obj.pushKV("lastrecv", stats.nLastRecv); | obj.pushKV("lastrecv", stats.nLastRecv); | ||||
obj.pushKV("bytessent", stats.nSendBytes); | obj.pushKV("bytessent", stats.nSendBytes); | ||||
obj.pushKV("bytesrecv", stats.nRecvBytes); | obj.pushKV("bytesrecv", stats.nRecvBytes); | ||||
obj.pushKV("conntime", stats.nTimeConnected); | obj.pushKV("conntime", stats.nTimeConnected); | ||||
▲ Show 20 Lines • Show All 755 Lines • Show Last 20 Lines |