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 and sukunrt committed Nov 6, 2023
1 parent 87a8d4e commit 3ff91cd
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 @@ -116,6 +116,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 3ff91cd

Please sign in to comment.