net_processing: don't modify addrman for private broadcast connections

It is best if the internal addrman database is not modified with
information coming from private broadcast connections because that
information can potentially later be sent via other connections.

Co-authored-by: Greg Sanders <gsanders87@gmail.com>
Co-authored-by: Lőrinc <pap.lorinc@gmail.com>
This commit is contained in:
Vasil Dimov
2026-04-08 06:51:59 +02:00
parent d2844c6a4f
commit 1ed1a12402
2 changed files with 32 additions and 1 deletions

View File

@@ -3600,7 +3600,7 @@ void PeerManagerImpl::ProcessMessage(Peer& peer, CNode& pfrom, const std::string
}
vRecv.ignore(8); // Ignore the addrMe service bits sent by the peer
vRecv >> CNetAddr::V1(addrMe);
if (!pfrom.IsInboundConn())
if (!pfrom.IsInboundConn() && !pfrom.IsPrivateBroadcastConn())
{
// Overwrites potentially existing services. In contrast to this,
// unvalidated services received via gossip relay in ADDR/ADDRV2