浏览代码

miner/worker: add missing timer.Stop call (#20857)

ucwong 5 年之前
父节点
当前提交
ad4b60efdd
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      miner/worker.go

+ 1 - 0
miner/worker.go

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