Merge pull request #206 from maticnetwork/fix-binary-search

Include upper bound in binary search
This commit is contained in:
Sandeep Sreenath 2021-10-14 16:35:43 +05:30 committed by GitHub
commit f020b88157
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -815,7 +815,7 @@ func (d *Downloader) findAncestor(p *peerConnection, remoteHeader *types.Header)
return 0, err
}
ancestor, err = d.findAncestorBinarySearch(p, mode, localHeight, floor)
ancestor, err = d.findAncestorBinarySearch(p, mode, localHeight+1, floor)
if err != nil {
return 0, err
}