Address #1538 and do not penalize peers for empty response. (#1811)

This commit is contained in:
Eugene Kabanov 2020-10-06 15:10:02 +03:00 committed by GitHub
parent 6bb6b66766
commit 27fc8bcc80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -89,7 +89,9 @@ proc fetchAncestorBlocksFromNetwork(rman: RequestManager,
res = Result[void, BlockError].ok()
if res.isOk():
peer.updateScore(PeerScoreGoodBlocks)
if len(ublocks) > 0:
# We reward peer only if it returns something.
peer.updateScore(PeerScoreGoodBlocks)
else:
# We are not penalizing other errors because of the reasons described
# above.