From 839b79167f0fd8655cd168d34295aa5b62664729 Mon Sep 17 00:00:00 2001 From: nk_ysg Date: Thu, 22 Aug 2024 18:42:02 +0800 Subject: [PATCH] rename --- crates/net/network-api/src/lib.rs | 2 +- crates/net/network/src/manager.rs | 2 +- crates/net/network/src/network.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/net/network-api/src/lib.rs b/crates/net/network-api/src/lib.rs index 5eb0059ad3523..43e87bd133582 100644 --- a/crates/net/network-api/src/lib.rs +++ b/crates/net/network-api/src/lib.rs @@ -184,7 +184,7 @@ pub trait Peers: PeersInfo { /// Disconnect an existing connection to the given peer using the provided reason fn disconnect_peer_with_reason(&self, peer: PeerId, reason: DisconnectReason); - /// Connect to the given peer. NOTE: if the maximum number out outbound sessions is reached, + /// Connect to the given peer. NOTE: if the maximum number out outbound sessions is reached, /// this won't do anything. See `reth_network::SessionManager::dial_outbound`. fn reconnect_peer(&self, addr: SocketAddr, peer: PeerId); diff --git a/crates/net/network/src/manager.rs b/crates/net/network/src/manager.rs index 99b293acc28d6..29197e2c47dde 100644 --- a/crates/net/network/src/manager.rs +++ b/crates/net/network/src/manager.rs @@ -588,7 +588,7 @@ impl NetworkManager { NetworkHandleMessage::DisconnectPeer(peer_id, reason) => { self.swarm.sessions_mut().disconnect(peer_id, reason); } - NetworkHandleMessage::ReConnect(socket_addr, peer_id) => { + NetworkHandleMessage::Connect(socket_addr, peer_id) => { self.swarm.sessions_mut().dial_outbound(socket_addr, peer_id); } NetworkHandleMessage::SetNetworkState(net_state) => { diff --git a/crates/net/network/src/network.rs b/crates/net/network/src/network.rs index 48d3d60c2407d..4774e52bb0327 100644 --- a/crates/net/network/src/network.rs +++ b/crates/net/network/src/network.rs @@ -304,7 +304,7 @@ impl Peers for NetworkHandle { /// Sends a message to the [`NetworkManager`](crate::NetworkManager) to reconnect to the given /// peer. fn reconnect_peer(&self, addr: SocketAddr, peer: PeerId) { - self.send_message(NetworkHandleMessage::ReConnect(addr, peer)) + self.send_message(NetworkHandleMessage::Connect(addr, peer)) } /// Send a reputation change for the given peer. @@ -487,6 +487,6 @@ pub(crate) enum NetworkHandleMessage { DiscoveryListener(UnboundedSender), /// Adds an additional `RlpxSubProtocol`. AddRlpxSubProtocol(RlpxSubProtocol), - /// Reconnect to the given peer. - ReConnect(SocketAddr, PeerId), + /// Connect to the given peer. + Connect(SocketAddr, PeerId), }