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:
parent
7659a134c9
commit
96b92552b9
1 changed files with 1 additions and 1 deletions
2
peer.go
2
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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue