Skip to content

Commit 04e045f

Browse files
committed
fix: restore nextTimeout tracking in resetTimeout
1 parent a0a3297 commit 04e045f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

p2p/discover/v4_udp.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,14 +453,15 @@ func (t *UDPv4) loop() {
453453
// Start the timer so it fires when the next pending reply has expired.
454454
now := time.Now()
455455
for p, el := range iterList[*replyMatcher](plist) {
456+
nextTimeout = p
456457
if dist := p.deadline.Sub(now); dist < 2*respTimeout {
457458
timeout.Reset(dist)
458459
return
459460
}
460461
// Remove pending replies whose deadline is too far in the
461462
// future. These can occur if the system clock jumped
462463
// backwards after the deadline was assigned.
463-
nextTimeout.errc <- errClockWarp
464+
p.errc <- errClockWarp
464465
plist.Remove(el)
465466
}
466467
nextTimeout = nil

0 commit comments

Comments
 (0)