We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c2a208f commit 52be237Copy full SHA for 52be237
hathor/p2p/manager.py
@@ -379,11 +379,14 @@ def on_peer_ready(self, protocol: HathorProtocol) -> None:
379
protocol.enable_sync()
380
381
# Notify other peers about this new peer connection.
382
+ self.relay_peer_to_ready_connections(protocol.my_peer)
383
+
384
+ def relay_peer_to_ready_connections(self, peer: PeerId):
385
+ """Relay peer to all ready connections."""
386
for conn in self.iter_ready_connections():
- if conn != protocol:
- assert conn.state is not None
387
+ if conn.peer != peer:
388
assert isinstance(conn.state, ReadyState)
- conn.state.send_peers([protocol.my_peer])
389
+ conn.state.send_peers([peer])
390
391
def on_peer_disconnect(self, protocol: HathorProtocol) -> None:
392
"""Called when a peer disconnect."""
0 commit comments