Skip to content

Commit

Permalink
Merge pull request #550 from frankcrypto2023/main
Browse files Browse the repository at this point in the history
fix cpu miner deadlock
  • Loading branch information
dindinw authored Sep 26, 2023
2 parents fb64d47 + e3952b2 commit bde9231
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions cmd/miner/symbols/lib/robot.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,18 +258,15 @@ func (this *QitmeerRobot) SubmitWork() {
this.InvalidShares++
}
}
this.SubmitLock.Unlock()
if err != ErrLimitWork { // limit wait block connect
time.AfterFunc(1*time.Second, func() {
this.SubmitLock.Lock()
r := this.Work.Get()
this.SubmitLock.Unlock()
if this.Work.Block != nil {
common.MinerLoger.Info("Change Task", "height", this.Work.Block.Height)
}
this.NotifyWork(r)
})
}
time.AfterFunc(1*time.Second, func() {
//this.SubmitLock.Lock()
r := this.Work.Get()
this.SubmitLock.Unlock()
if this.Work.Block != nil {
common.MinerLoger.Info("Change Task", "height", this.Work.Block.Height)
}
this.NotifyWork(r)
})
} else {
if !this.Pool { // solo
this.PendingLock.Lock()
Expand Down

0 comments on commit bde9231

Please sign in to comment.