Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriy0803 committed Dec 1, 2023
1 parent 30cefb5 commit fc99e15
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions proxy/stratum.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,11 @@ func (cs *Session) handleTCPMessage(s *ProxyServer, req *StratumReq) error {

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

cs.worker = id
// check Extranonce subscription.
extranonce := cs.Extranonce
if !cs.ExtranonceSub {
Expand Down

0 comments on commit fc99e15

Please sign in to comment.