0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-08 10:31:50 -05:00

[rpc] Remove deprecated "addnode" field from getpeerinfo

This commit is contained in:
Amiti Uttarwar 2020-12-22 16:44:53 -08:00
parent 02cf20b9f5
commit 537053336f
4 changed files with 0 additions and 19 deletions

View file

@ -587,7 +587,6 @@ void CNode::copyStats(CNodeStats &stats, const std::vector<bool> &m_asmap)
X(cleanSubVer); X(cleanSubVer);
} }
stats.fInbound = IsInboundConn(); stats.fInbound = IsInboundConn();
stats.m_manual_connection = IsManualConn();
X(m_bip152_highbandwidth_to); X(m_bip152_highbandwidth_to);
X(m_bip152_highbandwidth_from); X(m_bip152_highbandwidth_from);
{ {

View file

@ -702,7 +702,6 @@ public:
int nVersion; int nVersion;
std::string cleanSubVer; std::string cleanSubVer;
bool fInbound; bool fInbound;
bool m_manual_connection;
bool m_bip152_highbandwidth_to; bool m_bip152_highbandwidth_to;
bool m_bip152_highbandwidth_from; bool m_bip152_highbandwidth_from;
int m_starting_height; int m_starting_height;

View file

@ -128,8 +128,6 @@ static RPCHelpMan getpeerinfo()
{RPCResult::Type::BOOL, "inbound", "Inbound (true) or Outbound (false)"}, {RPCResult::Type::BOOL, "inbound", "Inbound (true) or Outbound (false)"},
{RPCResult::Type::BOOL, "bip152_hb_to", "Whether we selected peer as (compact blocks) high-bandwidth peer"}, {RPCResult::Type::BOOL, "bip152_hb_to", "Whether we selected peer as (compact blocks) high-bandwidth peer"},
{RPCResult::Type::BOOL, "bip152_hb_from", "Whether peer selected us as (compact blocks) high-bandwidth peer"}, {RPCResult::Type::BOOL, "bip152_hb_from", "Whether peer selected us as (compact blocks) high-bandwidth peer"},
{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") + ".\n" {RPCResult::Type::STR, "connection_type", "Type of connection: \n" + Join(CONNECTION_TYPE_DOC, ",\n") + ".\n"
"Please note this output is unlikely to be stable in upcoming releases as we iterate to\n" "Please note this output is unlikely to be stable in upcoming releases as we iterate to\n"
"best capture connection behaviors."}, "best capture connection behaviors."},
@ -224,10 +222,6 @@ static RPCHelpMan getpeerinfo()
obj.pushKV("inbound", stats.fInbound); obj.pushKV("inbound", stats.fInbound);
obj.pushKV("bip152_hb_to", stats.m_bip152_highbandwidth_to); obj.pushKV("bip152_hb_to", stats.m_bip152_highbandwidth_to);
obj.pushKV("bip152_hb_from", stats.m_bip152_highbandwidth_from); obj.pushKV("bip152_hb_from", stats.m_bip152_highbandwidth_from);
if (IsDeprecatedRPCEnabled("getpeerinfo_addnode")) {
// addnode is deprecated in v0.21 for removal in v0.22
obj.pushKV("addnode", stats.m_manual_connection);
}
if (fStateStats) { if (fStateStats) {
if (IsDeprecatedRPCEnabled("banscore")) { if (IsDeprecatedRPCEnabled("banscore")) {
// banscore is deprecated in v0.21 for removal in v0.22 // banscore is deprecated in v0.21 for removal in v0.22

View file

@ -14,7 +14,6 @@ class GetpeerinfoDeprecationTest(BitcoinTestFramework):
def run_test(self): def run_test(self):
self.test_banscore_deprecation() self.test_banscore_deprecation()
self.test_addnode_deprecation()
def test_banscore_deprecation(self): def test_banscore_deprecation(self):
self.log.info("Test getpeerinfo by default no longer returns a banscore field") self.log.info("Test getpeerinfo by default no longer returns a banscore field")
@ -23,16 +22,6 @@ class GetpeerinfoDeprecationTest(BitcoinTestFramework):
self.log.info("Test getpeerinfo returns banscore with -deprecatedrpc=banscore") self.log.info("Test getpeerinfo returns banscore with -deprecatedrpc=banscore")
assert "banscore" in self.nodes[1].getpeerinfo()[0].keys() assert "banscore" in self.nodes[1].getpeerinfo()[0].keys()
def test_addnode_deprecation(self):
self.restart_node(1, ["-deprecatedrpc=getpeerinfo_addnode"])
self.connect_nodes(0, 1)
self.log.info("Test getpeerinfo by default no longer returns an addnode field")
assert "addnode" not in self.nodes[0].getpeerinfo()[0].keys()
self.log.info("Test getpeerinfo returns addnode with -deprecatedrpc=addnode")
assert "addnode" in self.nodes[1].getpeerinfo()[0].keys()
if __name__ == "__main__": if __name__ == "__main__":
GetpeerinfoDeprecationTest().main() GetpeerinfoDeprecationTest().main()