Skip to content

Commit 9557271

Browse files
authored
eth: fix corner case in sync head determination (#21695)
This avoids synchronisation failures when the local header is ahead of the local full block.
1 parent 6477ea6 commit 9557271

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎eth/sync.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ func (cs *chainSyncer) modeAndLocalHead() (downloader.SyncMode, *big.Int) {
289289
}
290290
}
291291
// Nope, we're really full syncing
292-
head := cs.handler.chain.CurrentHeader()
293-
td := cs.handler.chain.GetTd(head.Hash(), head.Number.Uint64())
292+
head := cs.handler.chain.CurrentBlock()
293+
td := cs.handler.chain.GetTd(head.Hash(), head.NumberU64())
294294
return downloader.FullSync, td
295295
}
296296

0 commit comments

Comments
 (0)