forked from TrueCloudLab/neoneo-go
Merge pull request #2240 from nspcc-dev/fix-panic-in-network
Fix panic on peer disconnect
This commit is contained in:
commit
fe50f6edc7
2 changed files with 2 additions and 2 deletions
|
@ -393,7 +393,7 @@ func (s *Server) run() {
|
|||
s.lock.Unlock()
|
||||
s.log.Warn("peer disconnected",
|
||||
zap.Stringer("addr", drop.peer.RemoteAddr()),
|
||||
zap.String("reason", drop.reason.Error()),
|
||||
zap.Error(drop.reason),
|
||||
zap.Int("peerCount", s.PeerCount()))
|
||||
addr := drop.peer.PeerAddr().String()
|
||||
if drop.reason == errIdenticalID {
|
||||
|
|
|
@ -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