|
|
|
@ -5,6 +5,7 @@ import ( |
|
|
|
"crypto/tls" |
|
|
|
"crypto/tls" |
|
|
|
"encoding/json" |
|
|
|
"encoding/json" |
|
|
|
"errors" |
|
|
|
"errors" |
|
|
|
|
|
|
|
"fmt" |
|
|
|
"io" |
|
|
|
"io" |
|
|
|
"log" |
|
|
|
"log" |
|
|
|
"math/rand" |
|
|
|
"math/rand" |
|
|
|
@ -392,8 +393,12 @@ 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 cs.sendTCPResult(req.Id, true) |
|
|
|
// Return an error indicating that the method is not supported
|
|
|
|
|
|
|
|
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) |
|
|
|
} |
|
|
|
} |
|
|
|
|