handle all errors

This commit is contained in:
Manav Darji 2022-05-24 14:34:26 +05:30
parent 2b089ee6d3
commit c46a29340d

View file

@ -797,8 +797,7 @@ func (d *Downloader) getFetchHeadersByNumber(p *peerConnection) func(number uint
// the head links match), we do a binary search to find the common ancestor.
func (d *Downloader) findAncestor(p *peerConnection, remoteHeader *types.Header) (uint64, error) {
// Check the validity of chain to be downloaded
// TODO: we can use a mock and
if _, err := d.IsValidChain(remoteHeader, d.getFetchHeadersByNumber(p)); errors.Is(err, whitelist.ErrCheckpointMismatch) {
if _, err := d.IsValidChain(remoteHeader, d.getFetchHeadersByNumber(p)); err != nil {
return 0, err
}