From 658fb08c02e344fe0156933be8f2097852f13c4d Mon Sep 17 00:00:00 2001 From: Mike Zak Date: Tue, 4 Aug 2020 16:05:17 +0300 Subject: [PATCH] [NOD-1208] Do not ban if DisableBanning was turned on --- protocol/protocol.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol/protocol.go b/protocol/protocol.go index f2fa91e4f..20542c73f 100644 --- a/protocol/protocol.go +++ b/protocol/protocol.go @@ -74,7 +74,7 @@ func (m *Manager) routerInitializer(router *routerpkg.Router, netConnection *net func (m *Manager) handleError(err error, netConnection *netadapter.NetConnection) { if protocolErr := &(protocolerrors.ProtocolError{}); errors.As(err, &protocolErr) { - if protocolErr.ShouldBan { + if !m.context.Config().DisableBanning && protocolErr.ShouldBan { log.Warnf("Banning %s (reason: %s)", netConnection, protocolErr.Cause) err := m.context.ConnectionManager().Ban(netConnection) if err != nil && !errors.Is(err, addressmanager.ErrAddressNotFound) {