Skip to content

Commit

Permalink
trie, les: add missing calls to Ticker.Stop (ethereum#23415)
Browse files Browse the repository at this point in the history
  • Loading branch information
chuwt authored and zzyalbert committed Nov 26, 2021
1 parent 82079ce commit 115a232
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions les/pruner.go
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions trie/sync_bloom.go
Expand Up @@ -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:
Expand Down

0 comments on commit 115a232

Please sign in to comment.