Stop downloading objects with insufficient PoW

- object with insufficient PoW weren't correctly detected and it
tried to download them over and over again
This commit is contained in:
Peter Šurda 2017-10-20 13:21:39 +02:00
parent 2d34e73648
commit a746ba9da7
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -340,11 +340,11 @@ class BMProto(AdvancedDispatcher, ObjectTracker):
logger.info('The payload length of this object is too large (%s bytes). Ignoring it.' % len(self.payload) - self.payloadOffset) logger.info('The payload length of this object is too large (%s bytes). Ignoring it.' % len(self.payload) - self.payloadOffset)
raise BMProtoExcessiveDataError() raise BMProtoExcessiveDataError()
self.object.checkProofOfWorkSufficient()
try: try:
self.object.checkProofOfWorkSufficient()
self.object.checkEOLSanity() self.object.checkEOLSanity()
self.object.checkAlreadyHave() self.object.checkAlreadyHave()
except (BMObjectExpiredError, BMObjectAlreadyHaveError) as e: except (BMObjectExpiredError, BMObjectAlreadyHaveError, BMObjectInsufficientPOWError) as e:
BMProto.stopDownloadingObject(self.object.inventoryHash) BMProto.stopDownloadingObject(self.object.inventoryHash)
raise e raise e
try: try: