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