mirror of
https://github.com/cryptonote-social/csminer.git
synced 2024-09-11 05:35:23 +03:00
fix locking errors
This commit is contained in:
parent
3498d7c1bc
commit
07a6e9794d
@ -212,18 +212,20 @@ func reconnectClient(args *PoolLoginArgs) <-chan *client.MultiClientJob {
|
||||
}
|
||||
sleepSec := 3 * time.Second // time to sleep if connection attempt fails
|
||||
for {
|
||||
crylog.Info("Reconnecting...")
|
||||
err, code, message := cl.Connect("cryptonote.social:5555", false /*useTLS*/, args.Agent, loginName, args.Config, args.RigID)
|
||||
if err != nil {
|
||||
if code != 0 {
|
||||
crylog.Fatal("Pool server did not allow login due to error:", message)
|
||||
panic("can't handle pool login error during reconnect")
|
||||
}
|
||||
crylog.Error("Couldn't connect to pool server:", err)
|
||||
time.Sleep(sleepSec)
|
||||
sleepSec += time.Second
|
||||
if err == nil {
|
||||
crylog.Info("Reconnected.")
|
||||
jobChan, _ := cl.StartDispatching()
|
||||
return jobChan
|
||||
}
|
||||
jobChan, _ := cl.StartDispatching()
|
||||
return jobChan
|
||||
if code != 0 {
|
||||
crylog.Fatal("Pool server did not allow login due to error:", message)
|
||||
panic("can't handle pool login error during reconnect")
|
||||
}
|
||||
crylog.Error("Couldn't connect to pool server:", err)
|
||||
time.Sleep(sleepSec)
|
||||
sleepSec += time.Second
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -263,8 +263,6 @@ func (cl *Client) SubmitWork(nonce string, jobid string) (*SubmitWorkResponse, e
|
||||
}
|
||||
|
||||
func (cl *Client) String() string {
|
||||
cl.mutex.Lock()
|
||||
defer cl.mutex.Unlock()
|
||||
return "stratum_client:" + cl.address
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user