diff --git a/lbrynet/dht/node.py b/lbrynet/dht/node.py index fdc476a83..eca24d3c6 100644 --- a/lbrynet/dht/node.py +++ b/lbrynet/dht/node.py @@ -182,8 +182,9 @@ class Node(object): def printContacts(self, *args): print '\n\nNODE CONTACTS\n===============' for i in range(len(self._routingTable._buckets)): + print "bucket %i" % i for contact in self._routingTable._buckets[i]._contacts: - print contact + print " %s:%i" % (contact.address, contact.port) print '==================================' def getApproximateTotalDHTNodes(self): @@ -510,6 +511,7 @@ class Node(object): node is returning all of the contacts that it knows of. @rtype: list """ + # Get the sender's ID (if any) if '_rpcNodeID' in kwargs: rpc_sender_id = kwargs['_rpcNodeID'] diff --git a/lbrynet/dht/protocol.py b/lbrynet/dht/protocol.py index 1608ae6eb..fa6670c66 100644 --- a/lbrynet/dht/protocol.py +++ b/lbrynet/dht/protocol.py @@ -399,7 +399,7 @@ class KademliaProtocol(protocol.DatagramProtocol): def _msgTimeout(self, messageID): """ Called when an RPC request message times out """ # Find the message that timed out - if not self._sentMessages.has_key(messageID): + if messageID not in self._sentMessages: # This should never be reached log.error("deferred timed out, but is not present in sent messages list!") return diff --git a/lbrynet/dht/routingtable.py b/lbrynet/dht/routingtable.py index 6564b3647..86af043dc 100644 --- a/lbrynet/dht/routingtable.py +++ b/lbrynet/dht/routingtable.py @@ -84,7 +84,7 @@ class TreeRoutingTable(object): @type failure: twisted.python.failure.Failure """ failure.trap(TimeoutError) - print '==replacing contact==' + log.warning('==replacing contact==') # Remove the old contact... deadContactID = failure.getErrorMessage() try: