Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/net.cpp
Show First 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | return RPCHelpMan{ | ||||
{RPCResult::Type::NUM, "version", | {RPCResult::Type::NUM, "version", | ||||
"The peer version, such as 70001"}, | "The peer version, such as 70001"}, | ||||
{RPCResult::Type::STR, "subver", "The string version"}, | {RPCResult::Type::STR, "subver", "The string version"}, | ||||
{RPCResult::Type::BOOL, "inbound", | {RPCResult::Type::BOOL, "inbound", | ||||
"Inbound (true) or Outbound (false)"}, | "Inbound (true) or Outbound (false)"}, | ||||
{RPCResult::Type::BOOL, "addnode", | {RPCResult::Type::BOOL, "addnode", | ||||
"Whether connection was due to addnode/-connect or if it " | "Whether connection was due to addnode/-connect or if it " | ||||
"was an automatic/inbound connection"}, | "was an automatic/inbound connection"}, | ||||
{RPCResult::Type::BOOL, "addnode", | |||||
"Whether connection was due to addnode/-connect or if it " | |||||
"was an automatic/inbound connection\n(DEPRECATED, " | |||||
"returned only if the config option " | |||||
"-deprecatedrpc=getpeerinfo_addnode is passed)"}, | |||||
{RPCResult::Type::STR, "connection_type", | {RPCResult::Type::STR, "connection_type", | ||||
"Type of connection: \n" + | "Type of connection: \n" + | ||||
Join(CONNECTION_TYPE_DOC, ",\n") + "."}, | Join(CONNECTION_TYPE_DOC, ",\n") + "."}, | ||||
{RPCResult::Type::NUM, "startingheight", | {RPCResult::Type::NUM, "startingheight", | ||||
"The starting height (block) of the peer"}, | "The starting height (block) of the peer"}, | ||||
{RPCResult::Type::NUM, "banscore", | {RPCResult::Type::NUM, "banscore", | ||||
"The ban score (DEPRECATED, returned only if config " | "The ban score (DEPRECATED, returned only if config " | ||||
"option -deprecatedrpc=banscore is passed)"}, | "option -deprecatedrpc=banscore is passed)"}, | ||||
▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | return RPCHelpMan{ | ||||
double(stats.m_ping_wait_usec) / 1e6); | double(stats.m_ping_wait_usec) / 1e6); | ||||
} | } | ||||
obj.pushKV("version", stats.nVersion); | obj.pushKV("version", stats.nVersion); | ||||
// Use the sanitized form of subver here, to avoid tricksy | // Use the sanitized form of subver here, to avoid tricksy | ||||
// remote peers from corrupting or modifying the JSON output by | // remote peers from corrupting or modifying the JSON output by | ||||
// putting special characters in their ver message. | // putting special characters in their ver message. | ||||
obj.pushKV("subver", stats.cleanSubVer); | obj.pushKV("subver", stats.cleanSubVer); | ||||
obj.pushKV("inbound", stats.fInbound); | obj.pushKV("inbound", stats.fInbound); | ||||
if (IsDeprecatedRPCEnabled(gArgs, "getpeerinfo_addnode")) { | |||||
// addnode is deprecated in v0.24.5 for removal in v0.26.x | |||||
obj.pushKV("addnode", stats.m_manual_connection); | obj.pushKV("addnode", stats.m_manual_connection); | ||||
} | |||||
obj.pushKV("startingheight", stats.nStartingHeight); | obj.pushKV("startingheight", stats.nStartingHeight); | ||||
if (fStateStats) { | if (fStateStats) { | ||||
if (IsDeprecatedRPCEnabled(gArgs, "banscore")) { | if (IsDeprecatedRPCEnabled(gArgs, "banscore")) { | ||||
// banscore is deprecated in v0.22.11 for removal in | // banscore is deprecated in v0.22.11 for removal in | ||||
// v0.23 | // v0.23 | ||||
obj.pushKV("banscore", statestats.m_misbehavior_score); | obj.pushKV("banscore", statestats.m_misbehavior_score); | ||||
} | } | ||||
obj.pushKV("synced_headers", statestats.nSyncHeight); | obj.pushKV("synced_headers", statestats.nSyncHeight); | ||||
▲ Show 20 Lines • Show All 824 Lines • Show Last 20 Lines |