catch invalid data error
This commit is contained in:
parent
377442d9f0
commit
c85991704d
1 changed files with 4 additions and 0 deletions
|
@ -2,6 +2,7 @@ import asyncio
|
|||
import logging
|
||||
import typing
|
||||
import binascii
|
||||
from lbrynet.error import InvalidBlobHashError, InvalidDataError
|
||||
from lbrynet.blob_exchange.serialization import BlobResponse, BlobRequest
|
||||
if typing.TYPE_CHECKING:
|
||||
from lbrynet.blob.blob_file import BlobFile
|
||||
|
@ -111,6 +112,9 @@ class BlobExchangeClientProtocol(asyncio.Protocol):
|
|||
return False, True
|
||||
except asyncio.TimeoutError:
|
||||
return False, False
|
||||
except (InvalidBlobHashError, InvalidDataError):
|
||||
log.warning("invalid blob from %s:%i", self.peer_address, self.peer_port)
|
||||
return False, False
|
||||
finally:
|
||||
await self.close()
|
||||
|
||||
|
|
Loading…
Reference in a new issue