mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 22:26:42 +00:00
downloader: fixed bug in light mode
This commit is contained in:
parent
31d04569bd
commit
5ab65c3a1b
1 changed files with 4 additions and 2 deletions
|
|
@ -1712,8 +1712,10 @@ func (d *Downloader) processHeaders(origin uint64, td *big.Int) error {
|
|||
// L: Sync begins, and finds common ancestor at 11
|
||||
// L: Request new headers up from 11 (R's TD was higher, it must have something)
|
||||
// R: Nothing to give
|
||||
if !gotHeaders && td.Cmp(d.getTd(d.headBlock().Hash())) > 0 {
|
||||
return errStallingPeer
|
||||
if d.mode != LightSync {
|
||||
if !gotHeaders && td.Cmp(d.getTd(d.headBlock().Hash())) > 0 {
|
||||
return errStallingPeer
|
||||
}
|
||||
}
|
||||
// If fast or light syncing, ensure promised headers are indeed delivered. This is
|
||||
// needed to detect scenarios where an attacker feeds a bad pivot and then bails out
|
||||
|
|
|
|||
Loading…
Reference in a new issue