Skip to content

Commit

Permalink
resolve dead lock
Browse files Browse the repository at this point in the history
  • Loading branch information
krish-nr committed Sep 2, 2024
1 parent 329f945 commit e2b678b
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions miner/fix_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (fm *FixManager) StartFix(worker *worker, id engine.PayloadID, parentHash c
fm.mutex.Lock()
defer fm.mutex.Unlock()

if !fm.IsFixInProgress() {
if !fm.isFixInProgress {
fm.isFixInProgress = true
fixChan := make(chan struct{})
fm.fixChannels.Store(id, fixChan)
Expand Down Expand Up @@ -65,10 +65,3 @@ func (fm *FixManager) ListenFixCompletion(worker *worker, id engine.PayloadID, p
fm.listenerStarted.Delete(id) // 删除 listenerStarted 中的标记位
}()
}

// 检查 fix 是否正在进行
func (fm *FixManager) IsFixInProgress() bool {
fm.mutex.Lock()
defer fm.mutex.Unlock()
return fm.isFixInProgress
}

0 comments on commit e2b678b

Please sign in to comment.