p2p/discv5: add missing Timer.Stop calls (#20853)
This commit is contained in:
parent
f15849cf00
commit
c87cdd3053
@ -357,6 +357,8 @@ func (net *Network) loop() {
|
|||||||
bucketRefreshTimer = time.NewTimer(bucketRefreshInterval)
|
bucketRefreshTimer = time.NewTimer(bucketRefreshInterval)
|
||||||
refreshDone chan struct{} // closed when the 'refresh' lookup has ended
|
refreshDone chan struct{} // closed when the 'refresh' lookup has ended
|
||||||
)
|
)
|
||||||
|
defer refreshTimer.Stop()
|
||||||
|
defer bucketRefreshTimer.Stop()
|
||||||
|
|
||||||
// Tracking the next ticket to register.
|
// Tracking the next ticket to register.
|
||||||
var (
|
var (
|
||||||
@ -393,11 +395,13 @@ func (net *Network) loop() {
|
|||||||
searchInfo = make(map[Topic]topicSearchInfo)
|
searchInfo = make(map[Topic]topicSearchInfo)
|
||||||
activeSearchCount int
|
activeSearchCount int
|
||||||
)
|
)
|
||||||
|
defer topicRegisterLookupTick.Stop()
|
||||||
topicSearchLookupDone := make(chan topicSearchResult, 100)
|
topicSearchLookupDone := make(chan topicSearchResult, 100)
|
||||||
topicSearch := make(chan Topic, 100)
|
topicSearch := make(chan Topic, 100)
|
||||||
<-topicRegisterLookupTick.C
|
<-topicRegisterLookupTick.C
|
||||||
|
|
||||||
statsDump := time.NewTicker(10 * time.Second)
|
statsDump := time.NewTicker(10 * time.Second)
|
||||||
|
defer statsDump.Stop()
|
||||||
|
|
||||||
loop:
|
loop:
|
||||||
for {
|
for {
|
||||||
|
Loading…
Reference in New Issue
Block a user