From d17678fb429b12b1ef7b5852280ec22e0dbc125c Mon Sep 17 00:00:00 2001 From: yuriy0803 <68668177+yuriy0803@users.noreply.github.com> Date: Tue, 31 Oct 2023 14:44:17 +0100 Subject: [PATCH] update --- proxy/stratum.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/proxy/stratum.go b/proxy/stratum.go index 4ce54ff..5ef07fb 100644 --- a/proxy/stratum.go +++ b/proxy/stratum.go @@ -256,7 +256,7 @@ func (cs *Session) handleTCPMessage(s *ProxyServer, req *StratumReq) error { reply, errReply := s.handleLoginRPC(cs, params, req.Worker) if errReply != nil { return cs.sendStratumError(req.Id, []string{ - string(errReply.Code), + string(rune(errReply.Code)), errReply.Message, }) } @@ -418,7 +418,7 @@ func (cs *Session) handleTCPMessage(s *ProxyServer, req *StratumReq) error { hashrateStr := params[0] if !strings.HasPrefix(hashrateStr, "0x") { log.Println("Malformed hashrate value in eth_submitHashrate request from", cs.ip) - return errors.New("Malformed hashrate value") + return errors.New("malformed hashrate value") } hashrate, err := strconv.ParseInt(hashrateStr[2:], 16, 64) @@ -563,8 +563,8 @@ func (cs *Session) sendTCPReq(resp JSONStratumReq) error { return cs.enc.Encode(&resp) } -func (self *ProxyServer) setDeadline(conn net.Conn) { - conn.SetDeadline(time.Now().Add(self.timeout)) +func (s *ProxyServer) setDeadline(conn net.Conn) { + conn.SetDeadline(time.Now().Add(s.timeout)) } func (s *ProxyServer) registerSession(cs *Session) { @@ -586,7 +586,7 @@ func (cs *Session) sendJob(s *ProxyServer, id json.RawMessage, newjob bool) erro reply, errReply := s.handleGetWorkRPC(cs) if errReply != nil { return cs.sendStratumError(id, []string{ - string(errReply.Code), + string(rune(errReply.Code)), errReply.Message, }) }