Skip to content

Commit 5e33f76

Browse files
committed
p2p, rpc: address relay fixups
1 parent 87257d8 commit 5e33f76

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/net_processing.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ class PeerManagerImpl final : public PeerManager
652652
* @return True if address relay is enabled with peer
653653
* False if address relay is disallowed
654654
*/
655-
bool SetupAddressRelay(CNode& node, Peer& peer);
655+
bool SetupAddressRelay(const CNode& node, Peer& peer);
656656
};
657657
} // namespace
658658

@@ -4461,7 +4461,7 @@ class CompareInvMempoolOrder
44614461
};
44624462
}
44634463

4464-
bool PeerManagerImpl::SetupAddressRelay(CNode& node, Peer& peer)
4464+
bool PeerManagerImpl::SetupAddressRelay(const CNode& node, Peer& peer)
44654465
{
44664466
// We don't participate in addr relay with outbound block-relay-only
44674467
// connections to prevent providing adversaries with the additional

src/rpc/net.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ static RPCHelpMan getpeerinfo()
118118
{RPCResult::Type::STR, "addr", "(host:port) The IP address and port of the peer"},
119119
{RPCResult::Type::STR, "addrbind", "(ip:port) Bind address of the connection to the peer"},
120120
{RPCResult::Type::STR, "addrlocal", "(ip:port) Local address as reported by the peer"},
121-
{RPCResult::Type::BOOL, "addr_relay_enabled", "Whether we participate in address relay with this peer"},
122121
{RPCResult::Type::STR, "network", "Network (" + Join(GetNetworkNames(/* append_unroutable */ true), ", ") + ")"},
123122
{RPCResult::Type::NUM, "mapped_as", "The AS in the BGP route to the peer used for diversifying\n"
124123
"peer selection (only available if the asmap config flag is set)"},
@@ -151,6 +150,7 @@ static RPCHelpMan getpeerinfo()
151150
{
152151
{RPCResult::Type::NUM, "n", "The heights of blocks we're currently asking from this peer"},
153152
}},
153+
{RPCResult::Type::BOOL, "addr_relay_enabled", "Whether we participate in address relay with this peer"},
154154
{RPCResult::Type::ARR, "permissions", "Any special permissions that have been granted to this peer",
155155
{
156156
{RPCResult::Type::STR, "permission_type", Join(NET_PERMISSIONS_DOC, ",\n") + ".\n"},
@@ -202,7 +202,6 @@ static RPCHelpMan getpeerinfo()
202202
if (!(stats.addrLocal.empty())) {
203203
obj.pushKV("addrlocal", stats.addrLocal);
204204
}
205-
obj.pushKV("addr_relay_enabled", statestats.m_addr_relay_enabled);
206205
obj.pushKV("network", GetNetworkName(stats.m_network));
207206
if (stats.m_mapped_as != 0) {
208207
obj.pushKV("mapped_as", uint64_t(stats.m_mapped_as));
@@ -244,6 +243,7 @@ static RPCHelpMan getpeerinfo()
244243
heights.push_back(height);
245244
}
246245
obj.pushKV("inflight", heights);
246+
obj.pushKV("addr_relay_enabled", statestats.m_addr_relay_enabled);
247247
obj.pushKV("addr_processed", statestats.m_addr_processed);
248248
obj.pushKV("addr_rate_limited", statestats.m_addr_rate_limited);
249249
}

0 commit comments

Comments
 (0)