From 0c6d01184b7d195b290e1c5c72636d6c648180ea Mon Sep 17 00:00:00 2001 From: "Bora M. Alper" Date: Sat, 17 Jun 2017 15:18:17 +0300 Subject: [PATCH] fixed wrong naming (query/response confusion) --- magneticod/magneticod/dht.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/magneticod/magneticod/dht.py b/magneticod/magneticod/dht.py index 92c305a..1e0c467 100644 --- a/magneticod/magneticod/dht.py +++ b/magneticod/magneticod/dht.py @@ -181,7 +181,7 @@ class SybilNode(asyncio.DatagramProtocol): except (TypeError, KeyError, AssertionError): return - data = self.__build_GET_PEERS_query( + data = self.__build_GET_PEERS_response( info_hash[:15] + self.__true_id[:5], transaction_id, self.__calculate_token(addr, info_hash) ) @@ -213,7 +213,7 @@ class SybilNode(asyncio.DatagramProtocol): except (TypeError, KeyError, AssertionError): return - data = self.__build_ANNOUNCE_PEER_query(node_id[:15] + self.__true_id[:5], transaction_id) + data = self.__build_ANNOUNCE_PEER_response(node_id[:15] + self.__true_id[:5], transaction_id) self.sendto(data, addr) if implied_port: @@ -359,7 +359,7 @@ class SybilNode(asyncio.DatagramProtocol): ) @staticmethod - def __build_GET_PEERS_query(id_: bytes, transaction_id: bytes, token: bytes) -> bytes: # pylint: disable=invalid-name + def __build_GET_PEERS_response(id_: bytes, transaction_id: bytes, token: bytes) -> bytes: # pylint: disable=invalid-name """ Reference Implementation: bencode.dumps({ @@ -378,7 +378,7 @@ class SybilNode(asyncio.DatagramProtocol): ) @staticmethod - def __build_ANNOUNCE_PEER_query(id_: bytes, transaction_id: bytes) -> bytes: # pylint: disable=invalid-name + def __build_ANNOUNCE_PEER_response(id_: bytes, transaction_id: bytes) -> bytes: # pylint: disable=invalid-name """ Reference Implementation: bencode.dumps({