Skip to content

cmd/devp2p, cmd/wnode, whisper: add missing calls to Timer.Stop #20843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -894,6 +894,7 @@ func (whisper *Whisper) processQueue() {
func (whisper *Whisper) update() {
// Start a ticker to check for expirations
expire := time.NewTicker(expirationCycle)
defer expire.Stop()

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