|
|
|
@ -5,7 +5,6 @@ import ( |
|
|
|
"crypto/tls" |
|
|
|
"crypto/tls" |
|
|
|
"encoding/json" |
|
|
|
"encoding/json" |
|
|
|
"errors" |
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
|
|
|
|
|
"io" |
|
|
|
"io" |
|
|
|
"log" |
|
|
|
"log" |
|
|
|
"math/rand" |
|
|
|
"math/rand" |
|
|
|
@ -393,12 +392,8 @@ func (cs *Session) handleTCPMessage(s *ProxyServer, req *StratumReq) error { |
|
|
|
return cs.sendTCPResult(req.Id, &reply) |
|
|
|
return cs.sendTCPResult(req.Id, &reply) |
|
|
|
|
|
|
|
|
|
|
|
case "eth_submitHashrate": |
|
|
|
case "eth_submitHashrate": |
|
|
|
// Return an error indicating that the method is not supported
|
|
|
|
return cs.sendTCPResult(req.Id, true) |
|
|
|
errMsg := fmt.Sprintf("Method %s not supported", req.Method) |
|
|
|
|
|
|
|
errReply := &ErrorReply{Code: -32601, Message: errMsg} |
|
|
|
|
|
|
|
return cs.sendTCPError(req.Id, errReply) |
|
|
|
|
|
|
|
default: |
|
|
|
default: |
|
|
|
// Handle unknown methods
|
|
|
|
|
|
|
|
errReply := s.handleUnknownRPC(cs, req.Method) |
|
|
|
errReply := s.handleUnknownRPC(cs, req.Method) |
|
|
|
return cs.sendTCPError(req.Id, errReply) |
|
|
|
return cs.sendTCPError(req.Id, errReply) |
|
|
|
} |
|
|
|
} |
|
|
|
|