Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/net.cpp
Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | RPCHelpMan{ | ||||
" \"addr\":\"host:port\", (string) The IP address and port " | " \"addr\":\"host:port\", (string) The IP address and port " | ||||
"of the peer\n" | "of the peer\n" | ||||
" \"addrbind\":\"ip:port\", (string) Bind address of the " | " \"addrbind\":\"ip:port\", (string) Bind address of the " | ||||
"connection to the peer\n" | "connection to the peer\n" | ||||
" \"addrlocal\":\"ip:port\", (string) Local address as " | " \"addrlocal\":\"ip:port\", (string) Local address as " | ||||
"reported by the peer\n" | "reported by the peer\n" | ||||
" \"services\":\"xxxxxxxxxxxxxxxx\", (string) The services " | " \"services\":\"xxxxxxxxxxxxxxxx\", (string) The services " | ||||
"offered\n" | "offered\n" | ||||
" \"servicesnames\":[ (array) the services " | |||||
"offered, in human-readable form\n" | |||||
" \"SERVICE_NAME\", (string) the service name if " | |||||
"it is recognised\n" | |||||
" ...\n" | |||||
" ],\n" | |||||
" \"relaytxes\":true|false, (boolean) Whether peer has asked " | " \"relaytxes\":true|false, (boolean) Whether peer has asked " | ||||
"us to relay transactions to it\n" | "us to relay transactions to it\n" | ||||
" \"lastsend\": ttt, (numeric) The " + | " \"lastsend\": ttt, (numeric) The " + | ||||
UNIX_EPOCH_TIME + | UNIX_EPOCH_TIME + | ||||
" of the last send\n" | " of the last send\n" | ||||
" \"lastrecv\": ttt, (numeric) The " + | " \"lastrecv\": ttt, (numeric) The " + | ||||
UNIX_EPOCH_TIME + | UNIX_EPOCH_TIME + | ||||
" of the last receive\n" | " of the last receive\n" | ||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | for (const CNodeStats &stats : vstats) { | ||||
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()); | ||||
} | } | ||||
obj.pushKV("services", strprintf("%016x", stats.nServices)); | obj.pushKV("services", strprintf("%016x", 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); | ||||
obj.pushKV("timeoffset", stats.nTimeOffset); | obj.pushKV("timeoffset", stats.nTimeOffset); | ||||
if (stats.m_ping_usec > 0) { | if (stats.m_ping_usec > 0) { | ||||
▲ Show 20 Lines • Show All 342 Lines • ▼ Show 20 Lines | RPCHelpMan{ | ||||
" \"version\": xxxxx, (numeric) the " | " \"version\": xxxxx, (numeric) the " | ||||
"server version\n" | "server version\n" | ||||
" \"subversion\": \"/Satoshi:x.x.x/\", (string) the " | " \"subversion\": \"/Satoshi:x.x.x/\", (string) the " | ||||
"server subversion string\n" | "server subversion string\n" | ||||
" \"protocolversion\": xxxxx, (numeric) the " | " \"protocolversion\": xxxxx, (numeric) the " | ||||
"protocol version\n" | "protocol version\n" | ||||
" \"localservices\": \"xxxxxxxxxxxxxxxx\", (string) the " | " \"localservices\": \"xxxxxxxxxxxxxxxx\", (string) the " | ||||
"services we offer to the network\n" | "services we offer to the network\n" | ||||
" \"localservicesnames\": [ (array) the " | |||||
"services we offer to the network, in human-readable form\n" | |||||
" \"SERVICE_NAME\", (string) the " | |||||
"service name\n" | |||||
" ...\n" | |||||
" ],\n" | |||||
" \"localrelay\": true|false, (bool) true if " | " \"localrelay\": true|false, (bool) true if " | ||||
"transaction relay is requested from peers\n" | "transaction relay is requested from peers\n" | ||||
" \"timeoffset\": xxxxx, (numeric) the " | " \"timeoffset\": xxxxx, (numeric) the " | ||||
"time offset\n" | "time offset\n" | ||||
" \"connections\": xxxxx, (numeric) the " | " \"connections\": xxxxx, (numeric) the " | ||||
"number of connections\n" | "number of connections\n" | ||||
" \"networkactive\": true|false, (bool) whether " | " \"networkactive\": true|false, (bool) whether " | ||||
"p2p networking is enabled\n" | "p2p networking is enabled\n" | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | RPCHelpMan{ | ||||
.Check(request); | .Check(request); | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
UniValue obj(UniValue::VOBJ); | UniValue obj(UniValue::VOBJ); | ||||
obj.pushKV("version", CLIENT_VERSION); | obj.pushKV("version", CLIENT_VERSION); | ||||
obj.pushKV("subversion", userAgent(config)); | obj.pushKV("subversion", userAgent(config)); | ||||
obj.pushKV("protocolversion", PROTOCOL_VERSION); | obj.pushKV("protocolversion", PROTOCOL_VERSION); | ||||
if (g_rpc_node->connman) { | if (g_rpc_node->connman) { | ||||
obj.pushKV("localservices", | ServiceFlags services = g_rpc_node->connman->GetLocalServices(); | ||||
strprintf("%016x", g_rpc_node->connman->GetLocalServices())); | obj.pushKV("localservices", strprintf("%016x", services)); | ||||
obj.pushKV("localservicesnames", GetServicesNames(services)); | |||||
} | } | ||||
obj.pushKV("localrelay", g_relay_txes); | obj.pushKV("localrelay", g_relay_txes); | ||||
obj.pushKV("timeoffset", GetTimeOffset()); | obj.pushKV("timeoffset", GetTimeOffset()); | ||||
if (g_rpc_node->connman) { | if (g_rpc_node->connman) { | ||||
obj.pushKV("networkactive", g_rpc_node->connman->GetNetworkActive()); | obj.pushKV("networkactive", g_rpc_node->connman->GetNetworkActive()); | ||||
obj.pushKV("connections", int(g_rpc_node->connman->GetNodeCount( | obj.pushKV("connections", int(g_rpc_node->connman->GetNodeCount( | ||||
CConnman::CONNECTIONS_ALL))); | CConnman::CONNECTIONS_ALL))); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 292 Lines • Show Last 20 Lines |