From 20e9dd07378be8996fb4385ab72741629af56071 Mon Sep 17 00:00:00 2001 From: Alexander Simmerl Date: Mon, 21 May 2018 17:55:40 +0200 Subject: [PATCH] Return fake IP even when there is no conn --- p2p/peer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2p/peer.go b/p2p/peer.go index e8071626..39656efc 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -56,7 +56,7 @@ func (pc peerConn) RemoteIP() net.IP { return pc.ips[0] } - if pc.conn.RemoteAddr().String() == "pipe" { + if pc.conn == nil || pc.conn.RemoteAddr().String() == "pipe" { pc.ips = []net.IP{ net.IP{172, 16, 0, byte(atomic.AddUint32(&testIPSuffix, 1))}, }