From 3bb6e7b6555f3c8743a697cb9d509620714dc483 Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Sat, 3 Apr 2021 20:21:28 +0200 Subject: rpc: add network field to rpc getnodeaddresses --- src/rpc/net.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/rpc/net.cpp') diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index 96533a50c8..aff9bf7ae1 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -848,6 +848,7 @@ static RPCHelpMan getnodeaddresses() {RPCResult::Type::NUM, "services", "The services offered"}, {RPCResult::Type::STR, "address", "The address of the node"}, {RPCResult::Type::NUM, "port", "The port of the node"}, + {RPCResult::Type::STR, "network", "The network (" + Join(GetNetworkNames(), ", ") + ") the node connected through"}, }}, } }, @@ -879,6 +880,7 @@ static RPCHelpMan getnodeaddresses() obj.pushKV("services", (uint64_t)addr.nServices); obj.pushKV("address", addr.ToStringIP()); obj.pushKV("port", addr.GetPort()); + obj.pushKV("network", GetNetworkName(addr.GetNetClass())); ret.push_back(obj); } return ret; -- cgit v1.2.3