def handle(self, connection_id, message_content): response = GetPeersResponse() response.ParseFromString(message_content) LOGGER.debug("Got peers response message from %s. Endpoints: %s", connection_id, response.peer_endpoints) self._gossip.add_candidate_peer_endpoints(response.peer_endpoints) return HandlerResult(HandlerStatus.PASS)
def handle(self, connection_id, message_content): response = GetPeersResponse() response.ParseFromString(message_content) LOGGER.debug("got peers response message " "from %s. sending ack", connection_id) LOGGER.debug("PEERS RESPONSE ENDPOINTS: %s", response.peer_endpoints) self._gossip.add_candidate_peer_endpoints(response.peer_endpoints) return HandlerResult(HandlerStatus.PASS)
def handle(self, connection_id, message_content): response = GetPeersResponse() response.ParseFromString(message_content) LOGGER.debug("got peers response message " "from %s. sending ack", connection_id) LOGGER.debug("PEERS RESPONSE ENDPOINTS: %s", response.peer_endpoints) self._gossip.add_candidate_peer_endpoints(response.peer_endpoints) ack = NetworkAcknowledgement() ack.status = ack.OK return HandlerResult(HandlerStatus.RETURN, message_out=ack, message_type=validator_pb2.Message.NETWORK_ACK)