diff --git a/pkg/network/server.go b/pkg/network/server.go index c702a66ac..3eb6e06f7 100644 --- a/pkg/network/server.go +++ b/pkg/network/server.go @@ -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 { diff --git a/pkg/network/tcp_peer.go b/pkg/network/tcp_peer.go index 5b159fda1..a3b1dc45e 100644 --- a/pkg/network/tcp_peer.go +++ b/pkg/network/tcp_peer.go @@ -179,8 +179,8 @@ func (p *TCPPeer) handleConn() { p.incoming <- msg } } - close(p.incoming) p.Disconnect(err) + close(p.incoming) } func (p *TCPPeer) handleIncoming() {