From b5b1941d5ee68ac19eaebc88fcdc69d6b7cfac99 Mon Sep 17 00:00:00 2001 From: Zou Guangxian Date: Mon, 12 Oct 2020 18:40:11 +0800 Subject: [PATCH 1/3] fix synchronisation failure synchronisation failure when local header is ahead of local full block. --- eth/sync.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/sync.go b/eth/sync.go index 26badd1e21c..9db26cfdd34 100644 --- a/eth/sync.go +++ b/eth/sync.go @@ -287,7 +287,7 @@ func (cs *chainSyncer) modeAndLocalHead() (downloader.SyncMode, *big.Int) { } } // Nope, we're really full syncing - head := cs.pm.blockchain.CurrentHeader() + head := cs.pm.blockchain.CurrentBlock().Header() td := cs.pm.blockchain.GetTd(head.Hash(), head.Number.Uint64()) return downloader.FullSync, td } From b44e6ff26b781a439c015e459e83c2551bb2d95c Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 8 Dec 2020 10:51:29 +0100 Subject: [PATCH 2/3] Update sync.go --- eth/sync.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eth/sync.go b/eth/sync.go index 9db26cfdd34..dcd73bec048 100644 --- a/eth/sync.go +++ b/eth/sync.go @@ -287,8 +287,8 @@ func (cs *chainSyncer) modeAndLocalHead() (downloader.SyncMode, *big.Int) { } } // Nope, we're really full syncing - head := cs.pm.blockchain.CurrentBlock().Header() - td := cs.pm.blockchain.GetTd(head.Hash(), head.Number.Uint64()) + head := cs.pm.blockchain.CurrentBlock() + td := cs.pm.blockchain.GetTd(head.Hash(), head.NumberU64()) return downloader.FullSync, td } From 0bcf19ec43068a9f11e339ecb7f68a848445fae4 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 26 Mar 2021 14:43:31 +0100 Subject: [PATCH 3/3] Update sync.go --- eth/sync.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eth/sync.go b/eth/sync.go index 784cce730cc..4520ec68794 100644 --- a/eth/sync.go +++ b/eth/sync.go @@ -289,8 +289,8 @@ func (cs *chainSyncer) modeAndLocalHead() (downloader.SyncMode, *big.Int) { } } // Nope, we're really full syncing - head := cs.pm.blockchain.CurrentBlock() - td := cs.pm.blockchain.GetTd(head.Hash(), head.NumberU64()) + head := cs.handler.chain.CurrentBlock() + td := cs.handler.chain.GetTd(head.Hash(), head.NumberU64()) return downloader.FullSync, td }