File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -780,18 +780,13 @@ def __init__(self,
780
780
self .event_bus = event_bus
781
781
782
782
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 ):
787
784
# We are listening for all `PeerCountRequest` events but we ensure to only send a
788
785
# `PeerCountResponse` to the callsite that made the request. We do that by
789
786
# retrieving a `BroadcastConfig` from the request via the
790
787
# `event.broadcast_config()` API.
791
788
self .event_bus .broadcast (PeerCountResponse (len (self )), req .broadcast_config ())
792
789
793
- await self .wait (f ())
794
-
795
790
def __len__ (self ) -> int :
796
791
return len (self .connected_nodes )
797
792
You can’t perform that action at this time.
0 commit comments