diff --git a/peer.go b/peer.go index 0fa5573b..3fb600f0 100644 --- a/peer.go +++ b/peer.go @@ -1065,7 +1065,7 @@ func (p *peer) Disconnect() { return } close(p.quit) - if p.Connected() { + if atomic.LoadInt32(&p.connected) != 0 { p.conn.Close() } }