aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2020-08-20 18:42:54 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2020-10-14 14:16:42 +0000
commitd681a28219d3876a2b6e3cd2fb0d92963674903e (patch)
treeac1da24af138b3f755ea3ebe109ac9bd07a6fcf1 /src/rpc
parent99a1d572eabca89790216b3919a237e07063a376 (diff)
RPC: getpeerinfo: Deprecate "whitelisted" field (replaced by "permissions")
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/net.cpp8
1 files changed, 6 insertions, 2 deletions
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);