stop requesting peers which doesnt have a blob
This commit is contained in:
parent
7f6bbc0648
commit
5492ab9081
1 changed files with 4 additions and 0 deletions
|
@ -354,6 +354,10 @@ class AvailabilityRequest(RequestHelper):
|
||||||
log.debug("Received a response to the availability request")
|
log.debug("Received a response to the availability request")
|
||||||
# save available blobs
|
# save available blobs
|
||||||
blob_hashes = response_dict['available_blobs']
|
blob_hashes = response_dict['available_blobs']
|
||||||
|
if not blob_hashes:
|
||||||
|
# should not send any more requests as it doesnt have any blob we need
|
||||||
|
self.peer.update_score(-10.0)
|
||||||
|
return True
|
||||||
for blob_hash in blob_hashes:
|
for blob_hash in blob_hashes:
|
||||||
if blob_hash in request.request_dict['requested_blobs']:
|
if blob_hash in request.request_dict['requested_blobs']:
|
||||||
self.process_available_blob_hash(blob_hash, request)
|
self.process_available_blob_hash(blob_hash, request)
|
||||||
|
|
Loading…
Reference in a new issue