mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-26 14:00:29 +01:00
[net_processing] Defer initializing m_addr_known
Use SetupAddressRelay to only initialize `m_addr_known` as needed. For outbound peers, we initialize the filter before sending our self announcement (not applicable for block-relay-only connections). For inbound peers, we initialize the filter when we get an addr related message (ADDR, ADDRV2, GETADDR). These changes intend to mitigate address blackholes. Since an inbound peer has to send us an addr related message to become eligible as a candidate for addr relay, this should reduce our likelihood of sending them self-announcements.
This commit is contained in:
@@ -438,6 +438,7 @@ class P2PInterface(P2PConnection):
|
||||
self.send_message(msg_sendaddrv2())
|
||||
self.send_message(msg_verack())
|
||||
self.nServices = message.nServices
|
||||
self.send_message(msg_getaddr())
|
||||
|
||||
# Connection helper methods
|
||||
|
||||
|
||||
Reference in New Issue
Block a user