Skip to content

Commit

Permalink
swarm: fix timer Leak in the dial loop (#2636)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorropo authored Nov 6, 2023
1 parent 4e2a16d commit 2c43385
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions p2p/net/swarm/dial_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 2c43385

Please sign in to comment.