Skip to content

Commit

Permalink
use NewTimer instead of time.After
Browse files Browse the repository at this point in the history
  • Loading branch information
dean65 committed May 5, 2022
1 parent f027818 commit e93cced
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/remote_state_verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,12 @@ func (vm *remoteVerifyManager) AncestorVerified(header *types.Header) bool {
vm.taskLock.RLock()
task, exist := vm.tasks[hash]
vm.taskLock.RUnlock()
timeout := time.After(maxWaitVerifyResultTime)
timeout := time.NewTimer(maxWaitVerifyResultTime)
defer timeout.Stop()
if exist {
select {
case <-task.terminalCh:
case <-timeout:
case <-timeout.C:
return false
}
}
Expand Down

0 comments on commit e93cced

Please sign in to comment.