Log error in fetchBlocksFromPeer (#10959)

* Log error in `fetchBlocksFromPeer`

* update case
This commit is contained in:
Radosław Kapka 2022-06-30 18:22:10 +02:00 committed by GitHub
parent 69350a6a80
commit 8bedaaf0a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -289,9 +289,12 @@ func (f *blocksFetcher) fetchBlocksFromPeer(
Step: 1,
}
for i := 0; i < len(peers); i++ {
if blocks, err := f.requestBlocks(ctx, req, peers[i]); err == nil {
blocks, err := f.requestBlocks(ctx, req, peers[i])
if err == nil {
f.p2p.Peers().Scorers().BlockProviderScorer().Touch(peers[i])
return blocks, peers[i], err
} else {
log.WithError(err).Error("Could not request blocks by range")
}
}
return nil, "", errNoPeersAvailable