|
|
@ -112,7 +112,8 @@ static UniValue getpeerinfo(const JSONRPCRequest& request)
|
|
|
|
{RPCResult::Type::NUM, "version", "The peer version, such as 70001"},
|
|
|
|
{RPCResult::Type::NUM, "version", "The peer version, such as 70001"},
|
|
|
|
{RPCResult::Type::STR, "subver", "The string version"},
|
|
|
|
{RPCResult::Type::STR, "subver", "The string version"},
|
|
|
|
{RPCResult::Type::BOOL, "inbound", "Inbound (true) or Outbound (false)"},
|
|
|
|
{RPCResult::Type::BOOL, "inbound", "Inbound (true) or Outbound (false)"},
|
|
|
|
{RPCResult::Type::BOOL, "addnode", "Whether connection was due to addnode/-connect or if it 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", "Type of connection: \n" + Join(CONNECTION_TYPE_DOC, ",\n") + "."},
|
|
|
|
{RPCResult::Type::STR, "connection_type", "Type of connection: \n" + Join(CONNECTION_TYPE_DOC, ",\n") + "."},
|
|
|
|
{RPCResult::Type::NUM, "startingheight", "The starting height (block) of the peer"},
|
|
|
|
{RPCResult::Type::NUM, "startingheight", "The starting height (block) of the peer"},
|
|
|
|
{RPCResult::Type::NUM, "banscore", "The ban score (DEPRECATED, returned only if config option -deprecatedrpc=banscore is passed)"},
|
|
|
|
{RPCResult::Type::NUM, "banscore", "The ban score (DEPRECATED, returned only if config option -deprecatedrpc=banscore is passed)"},
|
|
|
@ -193,7 +194,10 @@ static UniValue getpeerinfo(const JSONRPCRequest& request)
|
|
|
|
// their ver message.
|
|
|
|
// their ver message.
|
|
|
|
obj.pushKV("subver", stats.cleanSubVer);
|
|
|
|
obj.pushKV("subver", stats.cleanSubVer);
|
|
|
|
obj.pushKV("inbound", stats.fInbound);
|
|
|
|
obj.pushKV("inbound", stats.fInbound);
|
|
|
|
obj.pushKV("addnode", stats.m_manual_connection);
|
|
|
|
if (IsDeprecatedRPCEnabled("getpeerinfo_addnode")) {
|
|
|
|
|
|
|
|
// addnode is deprecated in v0.21 for removal in v0.22
|
|
|
|
|
|
|
|
obj.pushKV("addnode", stats.m_manual_connection);
|
|
|
|
|
|
|
|
}
|
|
|
|
obj.pushKV("startingheight", stats.nStartingHeight);
|
|
|
|
obj.pushKV("startingheight", stats.nStartingHeight);
|
|
|
|
if (fStateStats) {
|
|
|
|
if (fStateStats) {
|
|
|
|
if (IsDeprecatedRPCEnabled("banscore")) {
|
|
|
|
if (IsDeprecatedRPCEnabled("banscore")) {
|
|
|
|