Procházet zdrojové kódy

eth: fix corner case in sync head determination (#21695)

This avoids synchronisation failures when the local header is ahead of
the local full block.
Zou Guangxian před 4 roky
rodič
revize
955727181b
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2 2
      eth/sync.go

+ 2 - 2
eth/sync.go

@@ -289,8 +289,8 @@ func (cs *chainSyncer) modeAndLocalHead() (downloader.SyncMode, *big.Int) {
 		}
 	}
 	// Nope, we're really full syncing
-	head := cs.handler.chain.CurrentHeader()
-	td := cs.handler.chain.GetTd(head.Hash(), head.Number.Uint64())
+	head := cs.handler.chain.CurrentBlock()
+	td := cs.handler.chain.GetTd(head.Hash(), head.NumberU64())
 	return downloader.FullSync, td
 }