aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/net.cpp
diff options
context:
space:
mode:
authorAmiti Uttarwar <amiti@uttarwar.org>2021-07-26 12:08:07 -0700
committerAmiti Uttarwar <amiti@uttarwar.org>2021-07-29 17:43:01 -0700
commit3893da06db1eb622f540605700f8663f8d87b2df (patch)
tree1fcd444d77b18137da6aaa29da8f104c8a96fad5 /src/rpc/net.cpp
parent0980ca78cd930a00c9985d7f00083a3b8e8be89e (diff)
downloadbitcoin-3893da06db1eb622f540605700f8663f8d87b2df.tar.xz
[RPC] Add field to getpeerinfo to indicate if addr relay is enabled
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 dba0f971b2..3962a13924 100644
--- a/src/rpc/net.cpp
+++ b/src/rpc/net.cpp
@@ -118,6 +118,7 @@ static RPCHelpMan getpeerinfo()
{RPCResult::Type::STR, "addr", "(host:port) The IP address and port of the peer"},
{RPCResult::Type::STR, "addrbind", "(ip:port) Bind address of the connection to the peer"},
{RPCResult::Type::STR, "addrlocal", "(ip:port) Local address as reported by the peer"},
+ {RPCResult::Type::BOOL, "addr_relay_enabled", "Whether we participate in address relay with this peer"},
{RPCResult::Type::STR, "network", "Network (" + Join(GetNetworkNames(/* append_unroutable */ true), ", ") + ")"},
{RPCResult::Type::NUM, "mapped_as", "The AS in the BGP route to the peer used for diversifying\n"
"peer selection (only available if the asmap config flag is set)"},
@@ -201,6 +202,7 @@ static RPCHelpMan getpeerinfo()
if (!(stats.addrLocal.empty())) {
obj.pushKV("addrlocal", stats.addrLocal);
}
+ obj.pushKV("addr_relay_enabled", statestats.m_addr_relay_enabled);
obj.pushKV("network", GetNetworkName(stats.m_network));
if (stats.m_mapped_as != 0) {
obj.pushKV("mapped_as", uint64_t(stats.m_mapped_as));