Skip to content

Commit 60b3e08

Browse files
committed
merge bitcoin#22616: address relay fixups
1 parent 8b8fbc5 commit 60b3e08

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
@@ -550,7 +550,7 @@ class PeerManagerImpl final : public PeerManager
550550
* @return True if address relay is enabled with peer
551551
* False if address relay is disallowed
552552
*/
553-
bool SetupAddressRelay(CNode& node, Peer& peer);
553+
bool SetupAddressRelay(const CNode& node, Peer& peer);
554554

555555
/** Number of nodes with fSyncStarted. */
556556
int nSyncStarted GUARDED_BY(cs_main) = 0;
@@ -5138,7 +5138,7 @@ class CompareInvMempoolOrder
51385138
};
51395139
}
51405140

5141-
bool PeerManagerImpl::SetupAddressRelay(CNode& node, Peer& peer)
5141+
bool PeerManagerImpl::SetupAddressRelay(const CNode& node, Peer& peer)
51425142
{
51435143
// We don't participate in addr relay with outbound block-relay-only
51445144
// 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
@@ -104,7 +104,6 @@ static RPCHelpMan getpeerinfo()
104104
{RPCResult::Type::STR, "addr", "(host:port) The IP address and port of the peer"},
105105
{RPCResult::Type::STR, "addrbind", "(ip:port) Bind address of the connection to the peer"},
106106
{RPCResult::Type::STR, "addrlocal", "(ip:port) Local address as reported by the peer"},
107-
{RPCResult::Type::BOOL, "addr_relay_enabled", "Whether we participate in address relay with this peer"},
108107
{RPCResult::Type::STR, "network", "Network (" + Join(GetNetworkNames(/* append_unroutable */ true), ", ") + ")"},
109108
{RPCResult::Type::STR, "mapped_as", "The AS in the BGP route to the peer used for diversifying peer selection"},
110109
{RPCResult::Type::STR_HEX, "services", "The services offered"},
@@ -146,6 +145,7 @@ static RPCHelpMan getpeerinfo()
146145
{
147146
{RPCResult::Type::NUM, "n", "The heights of blocks we're currently asking from this peer"},
148147
}},
148+
{RPCResult::Type::BOOL, "addr_relay_enabled", "Whether we participate in address relay with this peer"},
149149
{RPCResult::Type::BOOL, "whitelisted", "Whether the peer is whitelisted"},
150150
{RPCResult::Type::ARR, "permissions", "Any special permissions that have been granted to this peer",
151151
{
@@ -193,7 +193,6 @@ static RPCHelpMan getpeerinfo()
193193
if (!(stats.addrLocal.empty())) {
194194
obj.pushKV("addrlocal", stats.addrLocal);
195195
}
196-
obj.pushKV("addr_relay_enabled", statestats.m_addr_relay_enabled);
197196
obj.pushKV("network", GetNetworkName(stats.m_network));
198197
if (stats.m_mapped_as != 0) {
199198
obj.pushKV("mapped_as", uint64_t(stats.m_mapped_as));
@@ -245,6 +244,7 @@ static RPCHelpMan getpeerinfo()
245244
heights.push_back(height);
246245
}
247246
obj.pushKV("inflight", heights);
247+
obj.pushKV("addr_relay_enabled", statestats.m_addr_relay_enabled);
248248
obj.pushKV("addr_processed", statestats.m_addr_processed);
249249
obj.pushKV("addr_rate_limited", statestats.m_addr_rate_limited);
250250
}

0 commit comments

Comments
 (0)