Browse Source

update

master
yuriy0803 2 years ago
parent
commit
fc99e15954
  1. 9
      proxy/stratum.go

9
proxy/stratum.go

@ -221,9 +221,11 @@ func (cs *Session) handleTCPMessage(s *ProxyServer, req *StratumReq) error {
case "mining.extranonce.subscribe": case "mining.extranonce.subscribe":
var params []string var params []string
err := json.Unmarshal(req.Params, &params) if req.Params != nil {
if err != nil { err := json.Unmarshal(req.Params, &params)
return errors.New("invalid params") if err != nil {
return errors.New("invalid params")
}
} }
if len(params) == 0 { if len(params) == 0 {
if err := cs.sendStratumResult(req.Id, true); err != nil { if err := cs.sendStratumResult(req.Id, true); err != nil {
@ -264,6 +266,7 @@ func (cs *Session) handleTCPMessage(s *ProxyServer, req *StratumReq) error {
id = splitData[1] id = splitData[1]
} }
cs.worker = id
// check Extranonce subscription. // check Extranonce subscription.
extranonce := cs.Extranonce extranonce := cs.Extranonce
if !cs.ExtranonceSub { if !cs.ExtranonceSub {

Loading…
Cancel
Save