mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +00:00
if the target number is smaller than remote number, log but not return error
This commit is contained in:
parent
ca2c187844
commit
2034bf5da4
1 changed files with 3 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue