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")