diff --git a/magneticod/magneticod/bittorrent.py b/magneticod/magneticod/bittorrent.py index 6f3c98d..92efc19 100644 --- a/magneticod/magneticod/bittorrent.py +++ b/magneticod/magneticod/bittorrent.py @@ -26,7 +26,7 @@ InfoHash = bytes PeerAddress = typing.Tuple[str, int] -async def get_torrent_data(info_hash: InfoHash, peer_addr: PeerAddress, max_metadata_size): +async def fetch_metadata(info_hash: InfoHash, peer_addr: PeerAddress, max_metadata_size): loop = asyncio.get_event_loop() peer = DisposablePeer(info_hash, peer_addr, max_metadata_size) r = await peer.launch(loop) diff --git a/magneticod/magneticod/dht.py b/magneticod/magneticod/dht.py index 07053c6..dae64ac 100644 --- a/magneticod/magneticod/dht.py +++ b/magneticod/magneticod/dht.py @@ -182,7 +182,7 @@ class SybilNode: info_hash in self._complete_info_hashes: return - peer = bittorrent.get_torrent_data(info_hash, peer_addr, self.__max_metadata_size) + peer = bittorrent.fetch_metadata(info_hash, peer_addr, self.__max_metadata_size) self.__peers[info_hash].append(peer) self._loop.create_task(peer).add_done_callback(self.metadata_found)