diff --git a/csminer.go b/csminer.go index 68162f1..2e877f5 100644 --- a/csminer.go +++ b/csminer.go @@ -12,7 +12,7 @@ import ( const ( APPLICATION_NAME = "cryptonote.social Monero miner" - VERSION_STRING = "0.3.2" + VERSION_STRING = "0.3.3" STATS_WEBPAGE = "https://cryptonote.social/xmr" DONATE_USERNAME = "donate-getmonero-org" diff --git a/linux/README.txt b/linux/README.txt index eb9cb1a..2ef4bff 100644 --- a/linux/README.txt +++ b/linux/README.txt @@ -1,4 +1,4 @@ -csminer v0.3.2 (Linux/Gnome version) +csminer v0.3.3 (Linux/Gnome version) SYNOPSIS diff --git a/minerlib/minerlib.go b/minerlib/minerlib.go index e071f96..5081ebc 100644 --- a/minerlib/minerlib.go +++ b/minerlib/minerlib.go @@ -385,10 +385,10 @@ func MiningLoop(jobChan <-chan *client.MultiClientJob, done chan<- bool) { cl.Close() newChan := reconnectClient() if newChan == nil { + stopWorkers() // stop hashing if we're unable to reconnect since we can't submit shares crylog.Info("reconnect failed. sleeping for", sleepSec, "seconds before trying again") time.Sleep(sleepSec) sleepSec += time.Second - stopWorkers() // stop hashing if we're unable to reconnect since we can't submit shares continue } // Set up fresh stats for new connection diff --git a/stratum/client/client.go b/stratum/client/client.go index 77aed9d..7e35da2 100644 --- a/stratum/client/client.go +++ b/stratum/client/client.go @@ -230,13 +230,21 @@ func (cl *Client) Connect( return err, 0, "", nil } if response.Result == nil { - crylog.Error("Didn't get job result from login response:", response.Error) - return errors.New("stratum server error"), response.Error.Code, response.Error.Message, nil + if response.Error != nil { + crylog.Error("Didn't get job result from login response:", response.Error) + return errors.New("stratum server error"), response.Error.Code, response.Error.Message, nil + } + crylog.Error("Malformed login response:", response) + return errors.New("malformed login response"), 0, "", nil } cl.responseChannel = make(chan *Response) cl.alive = true jc := make(chan *MultiClientJob) + if response.Result.Job == nil { + crylog.Error("malformed login response result:", response.Result) + return errors.New("malformed login response case 2"), 0, "", nil + } response.Result.Job.ChatToken = response.ChatToken go dispatchJobs(cl.conn, jc, response.Result.Job, cl.responseChannel) if response.Warning != nil {