Skip to content

Commit 65273fa

Browse files
committed
Clear m_addr_known before our periodic self-advertisement
This behavior was apparently inadvertently broken in 5400ef6; without this change our daily self-announcements frequently go unsent, because our address is still in the peer's rolling bloom filter (for potentially many days, depending on addr traffic).
1 parent a0489f3 commit 65273fa

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/net_processing.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4074,6 +4074,15 @@ bool PeerManager::SendMessages(CNode* pto)
40744074
auto current_time = GetTime<std::chrono::microseconds>();
40754075

40764076
if (pto->RelayAddrsWithConn() && !::ChainstateActive().IsInitialBlockDownload() && pto->m_next_local_addr_send < current_time) {
4077+
// If we've sent before, clear the bloom filter for the peer, so that our
4078+
// self-announcement will actually go out.
4079+
// This might be unnecessary if the bloom filter has already rolled
4080+
// over since our last self-announcement, but there is only a small
4081+
// bandwidth cost that we can incur by doing this (which happens
4082+
// once a day on average).
4083+
if (pto->m_next_local_addr_send != std::chrono::microseconds::zero()) {
4084+
pto->m_addr_known->reset();
4085+
}
40774086
AdvertiseLocal(pto);
40784087
pto->m_next_local_addr_send = PoissonNextSend(current_time, AVG_LOCAL_ADDRESS_BROADCAST_INTERVAL);
40794088
}

0 commit comments

Comments
 (0)