Browse Source

swarm: fix timer Leak in the dial loop (#2636)

pull/2637/head
Jorropo 1 year ago
committed by GitHub
parent
commit
2c433852f7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      p2p/net/swarm/dial_worker.go

2
p2p/net/swarm/dial_worker.go

@ -120,6 +120,8 @@ func (w *dialWorker) loop() {
startTime := w.cl.Now()
// dialTimer is the dialTimer used to trigger dials
dialTimer := w.cl.InstantTimer(startTime.Add(math.MaxInt64))
defer dialTimer.Stop()
timerRunning := true
// scheduleNextDial updates timer for triggering the next dial
scheduleNextDial := func() {

Loading…
Cancel
Save