Skip to content

Commit d3e1a9d

Browse files
committed
Remove obsolete lahja hack
1 parent 8ba5ed7 commit d3e1a9d

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

trinity/nodes/base.py

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,15 @@ def __init__(self, event_bus: Endpoint, trinity_config: TrinityConfig) -> None:
5757
self.event_bus = event_bus
5858

5959
async def handle_network_id_requests(self) -> None:
60-
async def f() -> None:
61-
# FIXME: There must be a way to cancel event_bus.stream() when our token is triggered,
62-
# but for the time being we just wrap everything in self.wait().
63-
async for req in self.event_bus.stream(NetworkIdRequest):
64-
# We are listening for all `NetworkIdRequest` events but we ensure to only send a
65-
# `NetworkIdResponse` to the callsite that made the request. We do that by
66-
# retrieving a `BroadcastConfig` from the request via the
67-
# `event.broadcast_config()` API.
68-
self.event_bus.broadcast(
69-
NetworkIdResponse(self._network_id),
70-
req.broadcast_config()
71-
)
72-
73-
await self.wait(f())
60+
async for req in self.event_bus.stream(NetworkIdRequest):
61+
# We are listening for all `NetworkIdRequest` events but we ensure to only send a
62+
# `NetworkIdResponse` to the callsite that made the request. We do that by
63+
# retrieving a `BroadcastConfig` from the request via the
64+
# `event.broadcast_config()` API.
65+
self.event_bus.broadcast(
66+
NetworkIdResponse(self._network_id),
67+
req.broadcast_config()
68+
)
7469

7570
_chain_config: ChainConfig = None
7671

0 commit comments

Comments
 (0)