Improve naming.
This commit is contained in:
parent
eb8a2c72e6
commit
2f68ac3c7a
@ -26,7 +26,7 @@ InfoHash = bytes
|
|||||||
PeerAddress = typing.Tuple[str, int]
|
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()
|
loop = asyncio.get_event_loop()
|
||||||
peer = DisposablePeer(info_hash, peer_addr, max_metadata_size)
|
peer = DisposablePeer(info_hash, peer_addr, max_metadata_size)
|
||||||
r = await peer.launch(loop)
|
r = await peer.launch(loop)
|
||||||
|
@ -182,7 +182,7 @@ class SybilNode:
|
|||||||
info_hash in self._complete_info_hashes:
|
info_hash in self._complete_info_hashes:
|
||||||
return
|
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.__peers[info_hash].append(peer)
|
||||||
self._loop.create_task(peer).add_done_callback(self.metadata_found)
|
self._loop.create_task(peer).add_done_callback(self.metadata_found)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user