p2p/discover: fix waiting wrong duration (#35002)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run

The timer should wait the remaining time, not the elapsed time.
This commit is contained in:
cui 2026-06-21 07:15:26 +08:00 committed by GitHub
parent 7c9032dff6
commit e5ff3596db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -250,7 +250,7 @@ func (it *lookupIterator) slowdown() {
if diff > minInterval {
return
}
wait := time.NewTimer(diff)
wait := time.NewTimer(minInterval - diff)
defer wait.Stop()
select {
case <-wait.C: