From 5fcbaefd0b20af2a13ad9f6c3359b8c1ca096ba6 Mon Sep 17 00:00:00 2001 From: Maran Date: Mon, 12 May 2014 15:43:10 +0200 Subject: [PATCH] Don't forward localhost connections over the public network --- peer.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/peer.go b/peer.go index 54e6af823..d8168e455 100644 --- a/peer.go +++ b/peer.go @@ -534,7 +534,10 @@ func (p *Peer) peersMessage() *ethwire.Msg { outPeers := make([]interface{}, len(p.ethereum.InOutPeers())) // Serialise each peer for i, peer := range p.ethereum.InOutPeers() { - outPeers[i] = peer.RlpData() + // Don't return localhost as valid peer + if !net.ParseIP(peer.conn.RemoteAddr().String()).IsLoopback() { + outPeers[i] = peer.RlpData() + } } // Return the message to the peer with the known list of connected clients