catch TimeoutError in _IterativeFindHelper

This commit is contained in:
Jack Robison 2018-02-20 13:40:02 -05:00
parent 16fcc3f5c1
commit bdba263224
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -17,6 +17,7 @@ import constants
import routingtable
import datastore
import protocol
from error import TimeoutError
from peermanager import PeerManager
from hashannouncer import DHTHashAnnouncer
@ -799,7 +800,7 @@ class _IterativeFindHelper(object):
def removeFromShortlist(self, failure, deadContactID):
""" @type failure: twisted.python.failure.Failure """
failure.trap(protocol.TimeoutError)
failure.trap(TimeoutError, defer.CancelledError, TypeError)
if len(deadContactID) != constants.key_bits / 8:
raise ValueError("invalid lbry id")
if deadContactID in self.shortlist: