Skip to content

Commit

Permalink
p2p/discv5: add missing Timer.Stop calls (ethereum#20853)
Browse files Browse the repository at this point in the history
  • Loading branch information
ucwong authored Apr 2, 2020
1 parent f15849c commit c87cdd3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions p2p/discv5/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@ func (net *Network) loop() {
bucketRefreshTimer = time.NewTimer(bucketRefreshInterval)
refreshDone chan struct{} // closed when the 'refresh' lookup has ended
)
defer refreshTimer.Stop()
defer bucketRefreshTimer.Stop()

// Tracking the next ticket to register.
var (
Expand Down Expand Up @@ -393,11 +395,13 @@ func (net *Network) loop() {
searchInfo = make(map[Topic]topicSearchInfo)
activeSearchCount int
)
defer topicRegisterLookupTick.Stop()
topicSearchLookupDone := make(chan topicSearchResult, 100)
topicSearch := make(chan Topic, 100)
<-topicRegisterLookupTick.C

statsDump := time.NewTicker(10 * time.Second)
defer statsDump.Stop()

loop:
for {
Expand Down

0 comments on commit c87cdd3

Please sign in to comment.