From c6c244509b5c0371edcc719abb900cacf3429fde Mon Sep 17 00:00:00 2001 From: jholdstock Date: Fri, 15 Sep 2023 10:14:15 +0100 Subject: [PATCH] pool: Add missing response to subscribe handler. The handler for subscribe requests seemed to have incomplete error handling for the case where FetchMinerDifficulty failed. No response was being returned to the caller. This adds a generic Unknown error response so that the caller is not left hanging. --- pool/client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pool/client.go b/pool/client.go index 334fcdfd..11e318a0 100644 --- a/pool/client.go +++ b/pool/client.go @@ -394,6 +394,9 @@ func (c *Client) handleSubscribeRequest(req *Request, allowed bool) error { info, err := c.cfg.FetchMinerDifficulty(miner) if err != nil { c.mtx.Unlock() + sErr := NewStratumError(Unknown, err) + resp := SubscribeResponse(*req.ID, "", "", 0, sErr) + c.sendMessage(resp) return err } c.miner = miner