diff options
author | Maran <maran.hidskes@gmail.com> | 2014-05-12 21:43:10 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-05-12 21:43:10 +0800 |
commit | 5fcbaefd0b20af2a13ad9f6c3359b8c1ca096ba6 (patch) | |
tree | cd09318c6a7f0707cab095f0b97fea00374373f5 /peer.go | |
parent | 7f9fd0879207b7aba6c8e27d3e0b4672cba98bfb (diff) | |
download | go-tangerine-5fcbaefd0b20af2a13ad9f6c3359b8c1ca096ba6.tar go-tangerine-5fcbaefd0b20af2a13ad9f6c3359b8c1ca096ba6.tar.gz go-tangerine-5fcbaefd0b20af2a13ad9f6c3359b8c1ca096ba6.tar.bz2 go-tangerine-5fcbaefd0b20af2a13ad9f6c3359b8c1ca096ba6.tar.lz go-tangerine-5fcbaefd0b20af2a13ad9f6c3359b8c1ca096ba6.tar.xz go-tangerine-5fcbaefd0b20af2a13ad9f6c3359b8c1ca096ba6.tar.zst go-tangerine-5fcbaefd0b20af2a13ad9f6c3359b8c1ca096ba6.zip |
Don't forward localhost connections over the public network
Diffstat (limited to 'peer.go')
-rw-r--r-- | peer.go | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 |