Skip to content

Commit a7ed00f

Browse files
committed
rpc: expose high-bandwidth mode states via getpeerinfo
1 parent 30bc8fa commit a7ed00f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/rpc/net.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ static RPCHelpMan getpeerinfo()
116116
{RPCResult::Type::NUM, "version", "The peer version, such as 70001"},
117117
{RPCResult::Type::STR, "subver", "The string version"},
118118
{RPCResult::Type::BOOL, "inbound", "Inbound (true) or Outbound (false)"},
119+
{RPCResult::Type::BOOL, "bip152_hb_to", "Whether we selected peer as (compact blocks) high-bandwidth peer"},
120+
{RPCResult::Type::BOOL, "bip152_hb_from", "Whether peer selected us as (compact blocks) high-bandwidth peer"},
119121
{RPCResult::Type::BOOL, "addnode", "Whether connection was due to addnode/-connect or if it was an automatic/inbound connection\n"
120122
"(DEPRECATED, returned only if the config option -deprecatedrpc=getpeerinfo_addnode is passed)"},
121123
{RPCResult::Type::STR, "connection_type", "Type of connection: \n" + Join(CONNECTION_TYPE_DOC, ",\n") + "."},
@@ -198,6 +200,8 @@ static RPCHelpMan getpeerinfo()
198200
// their ver message.
199201
obj.pushKV("subver", stats.cleanSubVer);
200202
obj.pushKV("inbound", stats.fInbound);
203+
obj.pushKV("bip152_hb_to", stats.m_bip152_highbandwidth_to);
204+
obj.pushKV("bip152_hb_from", stats.m_bip152_highbandwidth_from);
201205
if (IsDeprecatedRPCEnabled("getpeerinfo_addnode")) {
202206
// addnode is deprecated in v0.21 for removal in v0.22
203207
obj.pushKV("addnode", stats.m_manual_connection);

0 commit comments

Comments
 (0)