Skip to content

Commit

Permalink
cmd/devp2p, cmd/wnode, whisper: add missing calls to Timer.Stop (ethe…
Browse files Browse the repository at this point in the history
  • Loading branch information
ucwong authored Apr 1, 2020
1 parent d56dc03 commit 1e2e1b4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/devp2p/crawl.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func (c *crawler) run(timeout time.Duration) nodeSet {
doneCh = make(chan enode.Iterator, len(c.iters))
liveIters = len(c.iters)
)
defer timeoutTimer.Stop()
for _, it := range c.iters {
go c.runIterator(doneCh, it)
}
Expand Down
1 change: 1 addition & 0 deletions cmd/wnode/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ func messageLoop() {
}

ticker := time.NewTicker(time.Millisecond * 50)
defer ticker.Stop()

for {
select {
Expand Down
1 change: 1 addition & 0 deletions whisper/whisperv6/whisper.go
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@ func (whisper *Whisper) update() {
defer whisper.wg.Done()
// Start a ticker to check for expirations
expire := time.NewTicker(expirationCycle)
defer expire.Stop()

// Repeat updates until termination is requested
for {
Expand Down

0 comments on commit 1e2e1b4

Please sign in to comment.