downloader: attempt span search if <= (+or equal) to maxheaderfetch

Signed-off-by: meows <b5c6@protonmail.com>
This commit is contained in:
meows 2020-05-11 15:44:39 -05:00
parent db63f1ee42
commit ca59775e1a
No known key found for this signature in database
GPG key ID: 5786AEA5C8D5A520

View file

@ -753,7 +753,7 @@ func (d *Downloader) findAncestor(p *peerConnection, remoteHeader *types.Header)
} }
// Only attempt span search if local head is "close" to reported remote // Only attempt span search if local head is "close" to reported remote
if remoteHeight-localHeight < uint64(MaxHeaderFetch) { if remoteHeight-localHeight <= uint64(MaxHeaderFetch) {
a, err := d.findAncestorSpanSearch(p, remoteHeight, localHeight, floor) a, err := d.findAncestorSpanSearch(p, remoteHeight, localHeight, floor)
if err == nil { if err == nil {
if a > localHeight { if a > localHeight {