mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-22 19:40:36 +00:00
cmd/devp2p, cmd/wnode, whisper: add missing calls to Timer.Stop (#20843)
This commit is contained in:
parent
d56dc038d2
commit
1e2e1b41f8
@ -63,6 +63,7 @@ func (c *crawler) run(timeout time.Duration) nodeSet {
|
|||||||
doneCh = make(chan enode.Iterator, len(c.iters))
|
doneCh = make(chan enode.Iterator, len(c.iters))
|
||||||
liveIters = len(c.iters)
|
liveIters = len(c.iters)
|
||||||
)
|
)
|
||||||
|
defer timeoutTimer.Stop()
|
||||||
for _, it := range c.iters {
|
for _, it := range c.iters {
|
||||||
go c.runIterator(doneCh, it)
|
go c.runIterator(doneCh, it)
|
||||||
}
|
}
|
||||||
|
@ -599,6 +599,7 @@ func messageLoop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ticker := time.NewTicker(time.Millisecond * 50)
|
ticker := time.NewTicker(time.Millisecond * 50)
|
||||||
|
defer ticker.Stop()
|
||||||
|
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
|
@ -905,6 +905,7 @@ func (whisper *Whisper) update() {
|
|||||||
defer whisper.wg.Done()
|
defer whisper.wg.Done()
|
||||||
// Start a ticker to check for expirations
|
// Start a ticker to check for expirations
|
||||||
expire := time.NewTicker(expirationCycle)
|
expire := time.NewTicker(expirationCycle)
|
||||||
|
defer expire.Stop()
|
||||||
|
|
||||||
// Repeat updates until termination is requested
|
// Repeat updates until termination is requested
|
||||||
for {
|
for {
|
||||||
|
Loading…
Reference in New Issue
Block a user