aboutsummaryrefslogtreecommitdiffstats
path: root/peer.go
diff options
context:
space:
mode:
authorMaran <maran.hidskes@gmail.com>2014-05-12 21:43:10 +0800
committerMaran <maran.hidskes@gmail.com>2014-05-12 21:43:10 +0800
commit5fcbaefd0b20af2a13ad9f6c3359b8c1ca096ba6 (patch)
treecd09318c6a7f0707cab095f0b97fea00374373f5 /peer.go
parent7f9fd0879207b7aba6c8e27d3e0b4672cba98bfb (diff)
downloadgo-tangerine-5fcbaefd0b20af2a13ad9f6c3359b8c1ca096ba6.tar.gz
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.go5
1 files changed, 4 insertions, 1 deletions
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