diff --git a/lbrynet/dht/node.py b/lbrynet/dht/node.py index 05bcdb0f5..4db51a55a 100644 --- a/lbrynet/dht/node.py +++ b/lbrynet/dht/node.py @@ -201,7 +201,6 @@ class Node: try: async with peer_generator as junction: yield junction - await peer_generator.finished.wait() finally: if add_hashes_task and not (add_hashes_task.done() or add_hashes_task.cancelled()): add_hashes_task.cancel() diff --git a/tests/unit/dht/test_blob_announcer.py b/tests/unit/dht/test_blob_announcer.py index 0b5415b76..f1fca0717 100644 --- a/tests/unit/dht/test_blob_announcer.py +++ b/tests/unit/dht/test_blob_announcer.py @@ -105,7 +105,7 @@ class TestBlobAnnouncer(AsyncioTestCase): _, task = last.accumulate_peers(search_q, peer_q) found_peers = await peer_q.get() - task.cancel() + await task self.assertEqual(1, len(found_peers)) self.assertEqual(self.node.protocol.node_id, found_peers[0].node_id)