mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-29 23:33:37 +00:00
network: log peerCount on connection registration
Symmetrical to disconnects, make it easier to look through the logs.
This commit is contained in:
parent
32695b4f40
commit
49bd7aada5
1 changed files with 1 additions and 1 deletions
|
@ -214,8 +214,8 @@ func (s *Server) run() {
|
|||
s.lock.Lock()
|
||||
s.peers[p] = true
|
||||
s.lock.Unlock()
|
||||
s.log.Info("new peer connected", zap.Stringer("addr", p.RemoteAddr()))
|
||||
peerCount := s.PeerCount()
|
||||
s.log.Info("new peer connected", zap.Stringer("addr", p.RemoteAddr()), zap.Int("peerCount", peerCount))
|
||||
if peerCount > s.MaxPeers {
|
||||
s.lock.RLock()
|
||||
// Pick a random peer and drop connection to it.
|
||||
|
|
Loading…
Reference in a new issue