From 5e9ccf42a310c822ce8ed5e7b354067ee5597d03 Mon Sep 17 00:00:00 2001 From: "C.S" Date: Thu, 24 Dec 2020 17:11:24 -0800 Subject: [PATCH] chat fixes --- minerlib/minerlib.go | 7 +++---- stratum/client/client.go | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/minerlib/minerlib.go b/minerlib/minerlib.go index a6b5b44..a444acc 100644 --- a/minerlib/minerlib.go +++ b/minerlib/minerlib.go @@ -385,6 +385,9 @@ func MiningLoop(jobChan <-chan *client.MultiClientJob, done chan<- bool) { } else { crylog.Info(infoStr, " Mining: ACTIVE") } + if job.ChatToken != chat.NextToken() { + go GetChats() + } case <-time.After(30 * time.Second): break @@ -392,10 +395,6 @@ func MiningLoop(jobChan <-chan *client.MultiClientJob, done chan<- bool) { stopWorkers() - if job.ChatToken != chat.NextToken() { - go GetChats() - } - // Check if we need to reinitialize rx dataset newSeed, err := hex.DecodeString(job.SeedHash) if err != nil { diff --git a/stratum/client/client.go b/stratum/client/client.go index c878b14..60eeba4 100644 --- a/stratum/client/client.go +++ b/stratum/client/client.go @@ -219,6 +219,7 @@ func (cl *Client) Connect( cl.responseChannel = make(chan *Response) cl.alive = true jc := make(chan *MultiClientJob) + response.Result.Job.ChatToken = response.ChatToken go dispatchJobs(cl.conn, jc, response.Result.Job, cl.responseChannel) if response.Warning != nil { return nil, response.Warning.Code, response.Warning.Message, jc