From 79bb9300c1b9fbc00701bd27d5f465df99752870 Mon Sep 17 00:00:00 2001 From: chuwt Date: Tue, 24 Aug 2021 16:51:28 +0800 Subject: [PATCH] trie, les: add missing calls to Ticker.Stop (#23415) --- les/pruner.go | 1 + trie/sync_bloom.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/les/pruner.go b/les/pruner.go index 622e64868..a1bd51d86 100644 --- a/les/pruner.go +++ b/les/pruner.go @@ -62,6 +62,7 @@ func (p *pruner) loop() { // cleanTicker is the ticker used to trigger a history clean 2 times a day. var cleanTicker = time.NewTicker(12 * time.Hour) + defer cleanTicker.Stop() // pruning finds the sections that have been processed by all indexers // and deletes all historical chain data. diff --git a/trie/sync_bloom.go b/trie/sync_bloom.go index 49986fcf0..91e5e6711 100644 --- a/trie/sync_bloom.go +++ b/trie/sync_bloom.go @@ -129,6 +129,8 @@ func (b *SyncBloom) init(database ethdb.Iteratee) { func (b *SyncBloom) meter() { // check every second tick := time.NewTicker(1 * time.Second) + defer tick.Stop() + for { select { case <-tick.C: