logging and docstring

This commit is contained in:
Jack Robison 2018-03-05 13:14:47 -05:00
parent cb09be5336
commit 5013426e02
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
2 changed files with 6 additions and 1 deletions

View file

@ -176,6 +176,11 @@ class Node(object):
raise ValueError("%s lbrynet may already be running." % str(e))
def bootstrap_join(self, known_node_addresses, finished_d):
"""
Attempt to join the dht, retry every 30 seconds if unsuccessful
:param known_node_addresses: [(str, int)] list of hostnames and ports for known dht seed nodes
:param finished_d: (defer.Deferred) called when join succeeds
"""
@defer.inlineCallbacks
def _resolve_seeds():
bootstrap_contacts = []

View file

@ -211,7 +211,7 @@ class KademliaProtocol(protocol.DatagramProtocol):
message = self._translator.fromPrimitive(msgPrimitive)
except (encoding.DecodeError, ValueError) as err:
# We received some rubbish here
log.exception("Decode error: %s", err)
log.exception("Error decoding datagram from %s:%i - %s", address[0], address[1], err)
return
except (IndexError, KeyError):
log.warning("Couldn't decode dht datagram from %s", address)