Skip to content

Commit 5370533

Browse files
committed
[rpc] Remove deprecated "addnode" field from getpeerinfo
1 parent 02cf20b commit 5370533

File tree

4 files changed

+0
-19
lines changed

4 files changed

+0
-19
lines changed

src/net.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,6 @@ void CNode::copyStats(CNodeStats &stats, const std::vector<bool> &m_asmap)
587587
X(cleanSubVer);
588588
}
589589
stats.fInbound = IsInboundConn();
590-
stats.m_manual_connection = IsManualConn();
591590
X(m_bip152_highbandwidth_to);
592591
X(m_bip152_highbandwidth_from);
593592
{

src/net.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,6 @@ class CNodeStats
702702
int nVersion;
703703
std::string cleanSubVer;
704704
bool fInbound;
705-
bool m_manual_connection;
706705
bool m_bip152_highbandwidth_to;
707706
bool m_bip152_highbandwidth_from;
708707
int m_starting_height;

src/rpc/net.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ static RPCHelpMan getpeerinfo()
128128
{RPCResult::Type::BOOL, "inbound", "Inbound (true) or Outbound (false)"},
129129
{RPCResult::Type::BOOL, "bip152_hb_to", "Whether we selected peer as (compact blocks) high-bandwidth peer"},
130130
{RPCResult::Type::BOOL, "bip152_hb_from", "Whether peer selected us as (compact blocks) high-bandwidth peer"},
131-
{RPCResult::Type::BOOL, "addnode", "Whether connection was due to addnode/-connect or if it was an automatic/inbound connection\n"
132-
"(DEPRECATED, returned only if the config option -deprecatedrpc=getpeerinfo_addnode is passed)"},
133131
{RPCResult::Type::STR, "connection_type", "Type of connection: \n" + Join(CONNECTION_TYPE_DOC, ",\n") + ".\n"
134132
"Please note this output is unlikely to be stable in upcoming releases as we iterate to\n"
135133
"best capture connection behaviors."},
@@ -224,10 +222,6 @@ static RPCHelpMan getpeerinfo()
224222
obj.pushKV("inbound", stats.fInbound);
225223
obj.pushKV("bip152_hb_to", stats.m_bip152_highbandwidth_to);
226224
obj.pushKV("bip152_hb_from", stats.m_bip152_highbandwidth_from);
227-
if (IsDeprecatedRPCEnabled("getpeerinfo_addnode")) {
228-
// addnode is deprecated in v0.21 for removal in v0.22
229-
obj.pushKV("addnode", stats.m_manual_connection);
230-
}
231225
if (fStateStats) {
232226
if (IsDeprecatedRPCEnabled("banscore")) {
233227
// banscore is deprecated in v0.21 for removal in v0.22

test/functional/rpc_getpeerinfo_deprecation.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ def set_test_params(self):
1414

1515
def run_test(self):
1616
self.test_banscore_deprecation()
17-
self.test_addnode_deprecation()
1817

1918
def test_banscore_deprecation(self):
2019
self.log.info("Test getpeerinfo by default no longer returns a banscore field")
@@ -23,16 +22,6 @@ def test_banscore_deprecation(self):
2322
self.log.info("Test getpeerinfo returns banscore with -deprecatedrpc=banscore")
2423
assert "banscore" in self.nodes[1].getpeerinfo()[0].keys()
2524

26-
def test_addnode_deprecation(self):
27-
self.restart_node(1, ["-deprecatedrpc=getpeerinfo_addnode"])
28-
self.connect_nodes(0, 1)
29-
30-
self.log.info("Test getpeerinfo by default no longer returns an addnode field")
31-
assert "addnode" not in self.nodes[0].getpeerinfo()[0].keys()
32-
33-
self.log.info("Test getpeerinfo returns addnode with -deprecatedrpc=addnode")
34-
assert "addnode" in self.nodes[1].getpeerinfo()[0].keys()
35-
3625

3726
if __name__ == "__main__":
3827
GetpeerinfoDeprecationTest().main()

0 commit comments

Comments
 (0)