diff options
author | hozan23 <hozan23@karyontech.net> | 2024-06-27 03:52:18 +0200 |
---|---|---|
committer | hozan23 <hozan23@karyontech.net> | 2024-06-27 23:32:10 +0200 |
commit | bcc6721257889f85f57af1b40351540585ffd41d (patch) | |
tree | 915adea7454fa91eafadfd9e7f9834a7cd0d9ebc /p2p/src/peer_pool.rs | |
parent | 7e4e25d9fbac403b0d46e8081baf00fb3865d56d (diff) |
Remove redundant type aliases
Diffstat (limited to 'p2p/src/peer_pool.rs')
-rw-r--r-- | p2p/src/peer_pool.rs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/p2p/src/peer_pool.rs b/p2p/src/peer_pool.rs index f8dda66..02a74ac 100644 --- a/p2p/src/peer_pool.rs +++ b/p2p/src/peer_pool.rs @@ -1,8 +1,4 @@ -use std::{ - collections::HashMap, - sync::{Arc, Weak}, - time::Duration, -}; +use std::{collections::HashMap, sync::Arc, time::Duration}; use async_channel::Sender; use bincode::{Decode, Encode}; @@ -21,16 +17,13 @@ use crate::{ conn_queue::{ConnDirection, ConnQueue}, message::{get_msg_payload, NetMsg, NetMsgCmd, VerAckMsg, VerMsg}, monitor::{Monitor, PPEvent}, - peer::{ArcPeer, Peer, PeerID}, + peer::Peer, protocol::{Protocol, ProtocolConstructor, ProtocolID}, protocols::PingProtocol, version::{version_match, Version, VersionInt}, - Error, Result, + Error, PeerID, Result, }; -pub type ArcPeerPool = Arc<PeerPool>; -pub type WeakPeerPool = Weak<PeerPool>; - pub struct PeerPool { /// Peer's ID pub id: PeerID, @@ -39,7 +32,7 @@ pub struct PeerPool { conn_queue: Arc<ConnQueue>, /// Holds the running peers. - peers: RwLock<HashMap<PeerID, ArcPeer>>, + peers: RwLock<HashMap<PeerID, Arc<Peer>>>, /// Hashmap contains protocol constructors. pub(crate) protocols: RwLock<HashMap<ProtocolID, Box<ProtocolConstructor>>>, |