mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 21:56:43 +00:00
eth/syncer: fix log
This commit is contained in:
parent
9fb9be5aa1
commit
4a898f52f6
1 changed files with 6 additions and 2 deletions
|
|
@ -95,9 +95,8 @@ func (s *Syncer) run() {
|
||||||
var (
|
var (
|
||||||
resync bool
|
resync bool
|
||||||
retries int
|
retries int
|
||||||
|
logged bool
|
||||||
)
|
)
|
||||||
log.Info("Waiting for peers to retrieve sync target", "hash", req.hash)
|
|
||||||
|
|
||||||
for {
|
for {
|
||||||
if retries >= 10 {
|
if retries >= 10 {
|
||||||
req.errc <- fmt.Errorf("sync target is not avaibale, %x", req.hash)
|
req.errc <- fmt.Errorf("sync target is not avaibale, %x", req.hash)
|
||||||
|
|
@ -112,6 +111,10 @@ func (s *Syncer) run() {
|
||||||
|
|
||||||
header, err := s.backend.Downloader().GetHeader(req.hash)
|
header, err := s.backend.Downloader().GetHeader(req.hash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if !logged {
|
||||||
|
logged = true
|
||||||
|
log.Info("Waiting for peers to retrieve sync target", "hash", req.hash)
|
||||||
|
}
|
||||||
time.Sleep(time.Second * time.Duration(retries+1))
|
time.Sleep(time.Second * time.Duration(retries+1))
|
||||||
retries++
|
retries++
|
||||||
continue
|
continue
|
||||||
|
|
@ -122,6 +125,7 @@ func (s *Syncer) run() {
|
||||||
}
|
}
|
||||||
target = header
|
target = header
|
||||||
resync = true
|
resync = true
|
||||||
|
break
|
||||||
}
|
}
|
||||||
if resync {
|
if resync {
|
||||||
req.errc <- s.backend.Downloader().BeaconDevSync(ethconfig.FullSync, target)
|
req.errc <- s.backend.Downloader().BeaconDevSync(ethconfig.FullSync, target)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue