Skip to content

Commit

Permalink
Merge pull request bnb-chain#471 from guagualvcha/down_nil_issue
Browse files Browse the repository at this point in the history
[R4R]fix downloader nil issue when the header is mising
  • Loading branch information
unclezoro authored Oct 20, 2021
2 parents 4edd2b1 + dc8df5c commit b6035c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eth/downloader/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -1028,8 +1028,8 @@ func (d *Downloader) findAncestorBinarySearch(p *peerConnection, mode SyncMode,
}
header := d.lightchain.GetHeaderByHash(h) // Independent of sync mode, header surely exists
if header == nil {
p.log.Error("header not found", "number", header.Number, "hash", header.Hash(), "request", check)
return 0, fmt.Errorf("%w: header no found (%d)", errBadPeer, header.Number)
p.log.Error("header not found", "hash", h, "request", check)
return 0, fmt.Errorf("%w: header no found (%s)", errBadPeer, h)
}
if header.Number.Uint64() != check {
p.log.Warn("Received non requested header", "number", header.Number, "hash", header.Hash(), "request", check)
Expand Down

0 comments on commit b6035c1

Please sign in to comment.