From 5ab65c3a1bf7af4b9d60accb7f8cfee74dd5659f Mon Sep 17 00:00:00 2001 From: zsfelfoldi Date: Mon, 20 Jun 2016 14:54:55 +0200 Subject: [PATCH] downloader: fixed bug in light mode --- eth/downloader/downloader.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index 7e5a9092c8..6e2680c321 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -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