For the full proposed diff:
0diff --git a/src/net.cpp b/src/net.cpp
1index 3cea184ac3..84692d2a79 100644
2--- a/src/net.cpp
3+++ b/src/net.cpp
4@@ -2669,7 +2669,7 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn
5 // Don't relay addr messages to peers that we connect to as block-relay-only
6 // peers (to prevent adversaries from inferring these links from addr
7 // traffic).
8- m_addr_relay_peer(!block_relay_only),
9+ m_addr_known{block_relay_only ? nullptr : MakeUnique<CRollingBloomFilter>(5000, 0.001)},
10 id(idIn),
11 nLocalHostNonce(nLocalHostNonceIn),
12 nLocalServices(nLocalServicesIn),
13@@ -2682,10 +2682,6 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn
14 m_tx_relay = MakeUnique<TxRelay>();
15 }
16
17- if (m_addr_relay_peer) {
18- m_addr_known = MakeUnique<CRollingBloomFilter>(5000, 0.001);
19- }
20-
21 for (const std::string &msg : getAllNetMessageTypes())
22 mapRecvBytesPerMsgCmd[msg] = 0;
23 mapRecvBytesPerMsgCmd[NET_MESSAGE_COMMAND_OTHER] = 0;
24diff --git a/src/net.h b/src/net.h
25index 327c06a306..d71e30377a 100644
26--- a/src/net.h
27+++ b/src/net.h
28@@ -776,13 +776,12 @@ public:
29
30 // flood relay
31 std::vector<CAddress> vAddrToSend;
32- std::unique_ptr<CRollingBloomFilter> m_addr_known;
33+ const std::unique_ptr<CRollingBloomFilter> m_addr_known;
34 bool fGetAddr{false};
35 int64_t nNextAddrSend GUARDED_BY(cs_sendProcessing){0};
36 int64_t nNextLocalAddrSend GUARDED_BY(cs_sendProcessing){0};
37
38- const bool m_addr_relay_peer;
39- bool IsAddrRelayPeer() const { return m_addr_relay_peer; }
40+ bool IsAddrRelayPeer() const { return bool{m_addr_known}; }
41
42 // List of block ids we still have announce.
43 // There is no final sorting before sending, as they are always sent immediately