소스 검색

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.