miner/worker | add timer stop to miner

This commit is contained in:
ucwong 2020-04-02 07:58:14 +00:00
parent f15849cf00
commit 108bf9937d

View file

@ -297,6 +297,7 @@ func (w *worker) newWorkLoop(recommit time.Duration) {
) )
timer := time.NewTimer(0) timer := time.NewTimer(0)
defer timer.Stop()
<-timer.C // discard the initial tick <-timer.C // discard the initial tick
// commit aborts in-flight transaction execution with given signal and resubmits a new one. // commit aborts in-flight transaction execution with given signal and resubmits a new one.