diff options
author | Amiti Uttarwar <amiti@uttarwar.org> | 2020-08-12 16:04:50 -0700 |
---|---|---|
committer | Amiti Uttarwar <amiti@uttarwar.org> | 2020-09-21 19:01:29 -0700 |
commit | 50f94b34a33c954f6e207f509c93d33267a5c3e2 (patch) | |
tree | 3ad8267877ba8e6e634707c79e22525b49d640ba /src | |
parent | df091b9b509f0b10e4315c0bfa2da0cc0c31c22f (diff) |
[rpc] Deprecate getpeerinfo addnode field
This field is now redundant since the connection type field will indicate
MANUAL for addnode connections.
Diffstat (limited to 'src')
-rw-r--r-- | src/rpc/net.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index e480bd2a40..e195affd54 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -112,7 +112,8 @@ static UniValue getpeerinfo(const JSONRPCRequest& request) {RPCResult::Type::NUM, "version", "The peer version, such as 70001"}, {RPCResult::Type::STR, "subver", "The string version"}, {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::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)"}, @@ -193,7 +194,10 @@ static UniValue getpeerinfo(const JSONRPCRequest& request) // their ver message. obj.pushKV("subver", stats.cleanSubVer); 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); if (fStateStats) { if (IsDeprecatedRPCEnabled("banscore")) { |