Can't use Connected() in Disconnect since it just set disconnected.

Use p.connected directly. This restores the correct disconnection of peers when
we go over the limit. Found by dhill, fix by me.
This commit is contained in:
Owain G. Ainsworth 2013-10-04 15:05:31 +01:00
parent 7659a134c9
commit 96b92552b9

View file

@ -1065,7 +1065,7 @@ func (p *peer) Disconnect() {
return
}
close(p.quit)
if p.Connected() {
if atomic.LoadInt32(&p.connected) != 0 {
p.conn.Close()
}
}