aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/net.cpp
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2021-04-03 20:21:28 +0200
committerJon Atack <jon@atack.com>2021-04-07 12:57:07 +0200
commit3bb6e7b6555f3c8743a697cb9d509620714dc483 (patch)
treeb93c6b0619e9670262ae143b3dbe6b1a73e2d9c8 /src/rpc/net.cpp
parentad4bf8a94594e7fe424e409ba9474d91584bb78c (diff)
downloadbitcoin-3bb6e7b6555f3c8743a697cb9d509620714dc483.tar.xz
rpc: add network field to rpc getnodeaddresses
Diffstat (limited to 'src/rpc/net.cpp')
-rw-r--r--src/rpc/net.cpp2
1 files changed, 2 insertions, 0 deletions
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;