From d681a28219d3876a2b6e3cd2fb0d92963674903e Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 20 Aug 2020 18:42:54 +0000 Subject: RPC: getpeerinfo: Deprecate "whitelisted" field (replaced by "permissions") --- src/rpc/net.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/rpc') diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index def21b119e..9eeedf889e 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -127,7 +127,8 @@ static RPCHelpMan getpeerinfo() { {RPCResult::Type::NUM, "n", "The heights of blocks we're currently asking from this peer"}, }}, - {RPCResult::Type::BOOL, "whitelisted", "Whether the peer is whitelisted"}, + {RPCResult::Type::BOOL, "whitelisted", /* optional */ true, "Whether the peer is whitelisted with default permissions\n" + "(DEPRECATED, returned only if config option -deprecatedrpc=whitelisted is passed)"}, {RPCResult::Type::NUM, "minfeefilter", "The minimum fee rate for transactions this peer accepts"}, {RPCResult::Type::OBJ_DYN, "bytessent_per_msg", "", { @@ -216,7 +217,10 @@ static RPCHelpMan getpeerinfo() } obj.pushKV("inflight", heights); } - obj.pushKV("whitelisted", stats.m_legacyWhitelisted); + if (IsDeprecatedRPCEnabled("whitelisted")) { + // whitelisted is deprecated in v0.21 for removal in v0.22 + obj.pushKV("whitelisted", stats.m_legacyWhitelisted); + } UniValue permissions(UniValue::VARR); for (const auto& permission : NetPermissions::ToStrings(stats.m_permissionFlags)) { permissions.push_back(permission); -- cgit v1.2.3 From 5b57dc5458800e56b4dddfeb32a1813804a62b0f Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Sat, 12 Sep 2020 17:41:04 +0000 Subject: RPC: getpeerinfo: Wrap long help line for bytesrecv_per_msg --- src/rpc/net.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/rpc') diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index 9eeedf889e..34ebe522a2 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -140,7 +140,8 @@ static RPCHelpMan getpeerinfo() { {RPCResult::Type::NUM, "msg", "The total bytes received aggregated by message type\n" "When a message type is not listed in this json object, the bytes received are 0.\n" - "Only known message types can appear as keys in the object and all bytes received of unknown message types are listed under '"+NET_MESSAGE_COMMAND_OTHER+"'."} + "Only known message types can appear as keys in the object and all bytes received\n" + "of unknown message types are listed under '"+NET_MESSAGE_COMMAND_OTHER+"'."} }}, }}, }}, -- cgit v1.2.3