Skip to content

Commit e93cced

Browse files
committed
use NewTimer instead of time.After
1 parent f027818 commit e93cced

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/remote_state_verifier.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,12 @@ func (vm *remoteVerifyManager) AncestorVerified(header *types.Header) bool {
222222
vm.taskLock.RLock()
223223
task, exist := vm.tasks[hash]
224224
vm.taskLock.RUnlock()
225-
timeout := time.After(maxWaitVerifyResultTime)
225+
timeout := time.NewTimer(maxWaitVerifyResultTime)
226+
defer timeout.Stop()
226227
if exist {
227228
select {
228229
case <-task.terminalCh:
229-
case <-timeout:
230+
case <-timeout.C:
230231
return false
231232
}
232233
}

0 commit comments

Comments
 (0)