eth/syncer: respect close signal during retry backoff

This commit is contained in:
Vicky 2026-02-17 00:59:36 +08:00
parent 0cba803fba
commit 4361057d42

View file

@ -117,7 +117,12 @@ func (s *Syncer) run() {
logged = true
log.Info("Waiting for peers to retrieve sync target", "hash", req.hash)
}
time.Sleep(time.Second * time.Duration(retries+1))
select {
case <-time.After(time.Second * time.Duration(retries+1)):
case <-s.closed:
req.errc <- errors.New("syncer closed")
return
}
retries++
continue
}