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++
|
retries++
|
||||||
continue
|
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 target != nil && header.Number.Cmp(target.Number) <= 0 {
|
||||||
// If the remote number is equal to the target, we don't need to resync.
|
log.Info("Syncer already synced", "hash", req.hash, "target", target)
|
||||||
if header.Number == target.Number {
|
|
||||||
req.errc <- nil
|
req.errc <- nil
|
||||||
} else {
|
|
||||||
req.errc <- fmt.Errorf("stale sync target, current: %d, received: %d", target.Number, header.Number)
|
|
||||||
}
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
target = header
|
target = header
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue