From 628c46e5d92ceeeb0b021b53f76e6abc3320a8b4 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Tue, 24 Oct 2017 20:12:05 -0400 Subject: [PATCH] catch id validation errors --- lbrynet/dht/protocol.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lbrynet/dht/protocol.py b/lbrynet/dht/protocol.py index e1d1fc122..9e535138e 100644 --- a/lbrynet/dht/protocol.py +++ b/lbrynet/dht/protocol.py @@ -205,14 +205,14 @@ class KademliaProtocol(protocol.DatagramProtocol): return try: msgPrimitive = self._encoder.decode(datagram) - except encoding.DecodeError: + message = self._translator.fromPrimitive(msgPrimitive) + except (encoding.DecodeError, ValueError): # We received some rubbish here return except IndexError: log.warning("Couldn't decode dht datagram from %s", address) return - message = self._translator.fromPrimitive(msgPrimitive) remoteContact = Contact(message.nodeID, address[0], address[1], self) now = time.time()