diff --git a/src/sakia/core/net/node.py b/src/sakia/core/net/node.py index 64c4aade5ac9bb86e3448a726ac5fd9751086f17..9970c8612f9d51978f86f03d964f2ec449a2a04e 100644 --- a/src/sakia/core/net/node.py +++ b/src/sakia/core/net/node.py @@ -463,14 +463,16 @@ class Node(QObject): try: leaf_data = yield from bma.network.peering.Peers(conn_handler).get(leaf=leaf_hash) if "raw" in leaf_data['leaf']['value']: - peer_doc = Peer.from_signed_raw("{0}{1}\n".format(leaf_data['leaf']['value']['raw'], - leaf_data['leaf']['value']['signature'])) + str_doc = "{0}{1}\n".format(leaf_data['leaf']['value']['raw'], + leaf_data['leaf']['value']['signature']) + peer_doc = Peer.from_signed_raw(str_doc) pubkey = leaf_data['leaf']['value']['pubkey'] self.neighbour_found.emit(peer_doc, pubkey) else: logging.debug("Incorrect leaf reply") - except ValueError as e: - logging.debug("Error in leaf reply") + except (AttributeError, ValueError) as e: + logging.debug("{pubkey} : Incorrect peer data in {leaf}".format(pubkey=self.pubkey[:5], + leaf=leaf_hash)) self.state = Node.OFFLINE self.changed.emit() except (ClientError, gaierror, asyncio.TimeoutError, DisconnectedError) as e: