Skip to content

Commit 1e2e1b4

Browse files
authored
cmd/devp2p, cmd/wnode, whisper: add missing calls to Timer.Stop (#20843)
1 parent d56dc03 commit 1e2e1b4

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

cmd/devp2p/crawl.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ func (c *crawler) run(timeout time.Duration) nodeSet {
6363
doneCh = make(chan enode.Iterator, len(c.iters))
6464
liveIters = len(c.iters)
6565
)
66+
defer timeoutTimer.Stop()
6667
for _, it := range c.iters {
6768
go c.runIterator(doneCh, it)
6869
}

cmd/wnode/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ func messageLoop() {
599599
}
600600

601601
ticker := time.NewTicker(time.Millisecond * 50)
602+
defer ticker.Stop()
602603

603604
for {
604605
select {

whisper/whisperv6/whisper.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,7 @@ func (whisper *Whisper) update() {
905905
defer whisper.wg.Done()
906906
// Start a ticker to check for expirations
907907
expire := time.NewTicker(expirationCycle)
908+
defer expire.Stop()
908909

909910
// Repeat updates until termination is requested
910911
for {

0 commit comments

Comments
 (0)