From dea7ef364c1a56e0313d275770d80efa22fa90fc Mon Sep 17 00:00:00 2001 From: David Hill Date: Fri, 13 Mar 2015 16:23:21 -0400 Subject: [PATCH] Ignore getaddr requests from outbound peers. This change reduces fingerprinting attacks and mimics Bitcoin Core commit dca799e1db6e319fdd47e0bfdb038eab0efabb85 --- peer.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/peer.go b/peer.go index 2bce1838..0f5ccb1a 100644 --- a/peer.go +++ b/peer.go @@ -1150,6 +1150,12 @@ func (p *peer) handleGetAddrMsg(msg *wire.MsgGetAddr) { return } + // Do not accept getaddr requests from outbound peers. This reduces + // fingerprinting attacks. + if !p.inbound { + return + } + // Get the current known addresses from the address manager. addrCache := p.server.addrManager.AddressCache()