From 80b83334698d098afbaee7bd5ad4862c742ae9eb Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Mon, 22 Nov 2021 21:08:01 -0800 Subject: [PATCH] [log] log too much peers (#3936) * [log] log too much peers * fix go import Signed-off-by: Leo Chen Co-authored-by: Nita Neou --- p2p/security/security.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/p2p/security/security.go b/p2p/security/security.go index ce823bec7..cdc8a3f89 100644 --- a/p2p/security/security.go +++ b/p2p/security/security.go @@ -4,6 +4,7 @@ import ( "fmt" "sync" + "github.com/harmony-one/harmony/internal/utils" libp2p_network "github.com/libp2p/go-libp2p-core/network" ma "github.com/multiformats/go-multiaddr" "github.com/pkg/errors" @@ -54,6 +55,8 @@ func (m *Manager) OnConnectCheck(net libp2p_network.Network, conn libp2p_network } if len(peers) > m.maxConnPerIP { + utils.Logger().Warn().Int("len(peers)", len(peers)).Int("maxConnPerIP", m.maxConnPerIP). + Msg("Too much peers, closing") return net.ClosePeer(conn.RemotePeer()) }