Skip to content

Commit 7ad4ea1

Browse files
committed
Remove obsolete hack
1 parent 9eabc8d commit 7ad4ea1

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

p2p/peer.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -780,18 +780,13 @@ def __init__(self,
780780
self.event_bus = event_bus
781781

782782
async def handle_peer_count_requests(self) -> None:
783-
async def f() -> None:
784-
# FIXME: There must be a way to cancel event_bus.stream() when our token is triggered,
785-
# but for the time being we just wrap everything in self.wait().
786-
async for req in self.event_bus.stream(PeerCountRequest):
783+
async for req in self.event_bus.stream(PeerCountRequest):
787784
# We are listening for all `PeerCountRequest` events but we ensure to only send a
788785
# `PeerCountResponse` to the callsite that made the request. We do that by
789786
# retrieving a `BroadcastConfig` from the request via the
790787
# `event.broadcast_config()` API.
791788
self.event_bus.broadcast(PeerCountResponse(len(self)), req.broadcast_config())
792789

793-
await self.wait(f())
794-
795790
def __len__(self) -> int:
796791
return len(self.connected_nodes)
797792

0 commit comments

Comments
 (0)