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