@@ -112,7 +112,7 @@ static UniValue getpeerinfo(const JSONRPCRequest& request)
112
112
{RPCResult::Type::BOOL, " inbound" , " Inbound (true) or Outbound (false)" },
113
113
{RPCResult::Type::BOOL, " addnode" , " Whether connection was due to addnode/-connect or if it was an automatic/inbound connection" },
114
114
{RPCResult::Type::NUM, " startingheight" , " The starting height (block) of the peer" },
115
- {RPCResult::Type::NUM, " banscore" , " The ban score" },
115
+ {RPCResult::Type::NUM, " banscore" , " The ban score (DEPRECATED, returned only if config option -deprecatedrpc=banscore is passed) " },
116
116
{RPCResult::Type::NUM, " synced_headers" , " The last header we have in common with this peer" },
117
117
{RPCResult::Type::NUM, " synced_blocks" , " The last block we have in common with this peer" },
118
118
{RPCResult::Type::ARR, " inflight" , " " ,
@@ -191,7 +191,10 @@ static UniValue getpeerinfo(const JSONRPCRequest& request)
191
191
obj.pushKV (" addnode" , stats.m_manual_connection );
192
192
obj.pushKV (" startingheight" , stats.nStartingHeight );
193
193
if (fStateStats ) {
194
- obj.pushKV (" banscore" , statestats.nMisbehavior );
194
+ if (IsDeprecatedRPCEnabled (" banscore" )) {
195
+ // banscore is deprecated in v0.21 for removal in v0.22
196
+ obj.pushKV (" banscore" , statestats.nMisbehavior );
197
+ }
195
198
obj.pushKV (" synced_headers" , statestats.nSyncHeight );
196
199
obj.pushKV (" synced_blocks" , statestats.nCommonHeight );
197
200
UniValue heights (UniValue::VARR);
0 commit comments