mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-23 13:41:37 +00:00
network: fix disconnection race between handleConn() and handleIncoming()
handleIncoming() winning the race for p.Disconnect() call might lead to nil error passed as the reason for peer unregistration.
This commit is contained in:
parent
2eeec73770
commit
774dee3cd4
1 changed files with 1 additions and 1 deletions
|
@ -179,8 +179,8 @@ func (p *TCPPeer) handleConn() {
|
|||
p.incoming <- msg
|
||||
}
|
||||
}
|
||||
close(p.incoming)
|
||||
p.Disconnect(err)
|
||||
close(p.incoming)
|
||||
}
|
||||
|
||||
func (p *TCPPeer) handleIncoming() {
|
||||
|
|
Loading…
Reference in a new issue