Commit 5fcbaefd authored by Maran's avatar Maran

Don't forward localhost connections over the public network

parent 7f9fd087
...@@ -534,8 +534,11 @@ func (p *Peer) peersMessage() *ethwire.Msg { ...@@ -534,8 +534,11 @@ func (p *Peer) peersMessage() *ethwire.Msg {
outPeers := make([]interface{}, len(p.ethereum.InOutPeers())) outPeers := make([]interface{}, len(p.ethereum.InOutPeers()))
// Serialise each peer // Serialise each peer
for i, peer := range p.ethereum.InOutPeers() { for i, peer := range p.ethereum.InOutPeers() {
// Don't return localhost as valid peer
if !net.ParseIP(peer.conn.RemoteAddr().String()).IsLoopback() {
outPeers[i] = peer.RlpData() outPeers[i] = peer.RlpData()
} }
}
// Return the message to the peer with the known list of connected clients // Return the message to the peer with the known list of connected clients
return ethwire.NewMessage(ethwire.MsgPeersTy, outPeers) return ethwire.NewMessage(ethwire.MsgPeersTy, outPeers)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment