From 7c1950f517091412a13504831c3b1c937385804c Mon Sep 17 00:00:00 2001 From: yuriy0803 <68668177+yuriy0803@users.noreply.github.com> Date: Sun, 14 Mar 2021 11:31:21 +0100 Subject: [PATCH] Debug --- api.json | 1 + proxy/config.go | 1 + proxy/handlers.go | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/api.json b/api.json index b1668a3..816a81d 100644 --- a/api.json +++ b/api.json @@ -17,6 +17,7 @@ "hashrateExpiration": "3h", "healthCheck": true, + "debug": true, "maxFails": 100, "stratum": { diff --git a/proxy/config.go b/proxy/config.go index a52f60c..c4701ce 100644 --- a/proxy/config.go +++ b/proxy/config.go @@ -45,6 +45,7 @@ type Proxy struct { MaxFails int64 `json:"maxFails"` HealthCheck bool `json:"healthCheck"` + Debug bool `json:"debug"` Stratum Stratum `json:"stratum"` diff --git a/proxy/handlers.go b/proxy/handlers.go index 103935e..921dc93 100644 --- a/proxy/handlers.go +++ b/proxy/handlers.go @@ -86,7 +86,10 @@ func (s *ProxyServer) handleSubmitRPC(cs *Session, login, id string, params []st cs.lastErr = errors.New("Invalid share") } } - 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 { cs.lastErr = errors.New("High rate of invalid shares")