From fc64a09f886441cc0ff71314fdbdffc1d0f3026c Mon Sep 17 00:00:00 2001 From: yuriy0803 <68668177+yuriy0803@users.noreply.github.com> Date: Tue, 16 Aug 2022 11:59:21 +0200 Subject: [PATCH] Update handlers.go --- proxy/handlers.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/proxy/handlers.go b/proxy/handlers.go index 36c2f3d..05874f8 100644 --- a/proxy/handlers.go +++ b/proxy/handlers.go @@ -72,10 +72,6 @@ func (s *ProxyServer) handleSubmitRPC(cs *Session, login, id string, params []st exist, validShare := s.processShare(login, id, cs.ip, t, params) ok := s.policy.ApplySharePolicy(cs.ip, !exist && validShare) - if s.config.Proxy.Debug { - log.Printf("Valid share from %s@%s", login, cs.ip) - } - if exist { log.Printf("Duplicate share from %s@%s %v", login, cs.ip, params) return false, &ErrorReply{Code: 22, Message: "Duplicate share"} @@ -89,7 +85,10 @@ func (s *ProxyServer) handleSubmitRPC(cs *Session, login, id string, params []st } return false, nil } - log.Printf("Valid share from %s@%s", login, cs.ip) + + if s.config.Proxy.Debug { + log.Printf("Valid share from %s@%s", login, cs.ip) + } if !ok { return true, &ErrorReply{Code: -1, Message: "High rate of invalid shares"}