if the target number is smaller than remote number, log but not return error

This commit is contained in:
maskpp 2025-08-03 12:18:58 +08:00
parent ca2c187844
commit 2034bf5da4

View file

@ -119,13 +119,10 @@ func (s *Syncer) run() {
retries++
continue
}
// If the remote number is equal or bigger to the target, we don't need to resync.
if target != nil && header.Number.Cmp(target.Number) <= 0 {
// If the remote number is equal to the target, we don't need to resync.
if header.Number == target.Number {
req.errc <- nil
} else {
req.errc <- fmt.Errorf("stale sync target, current: %d, received: %d", target.Number, header.Number)
}
log.Info("Syncer already synced", "hash", req.hash, "target", target)
req.errc <- nil
break
}
target = header