Skip to content

Commit b92e62d

Browse files
committed
client pool -> peer set
1 parent b5dd497 commit b92e62d

File tree

15 files changed

+285
-555
lines changed

15 files changed

+285
-555
lines changed

Cargo.lock

Lines changed: 0 additions & 175 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
resolver = "2"
33

44
members = [
5-
"binaries/cuprated",
5+
#"binaries/cuprated",
66
"constants",
77
"consensus",
88
"consensus/context",

p2p/p2p-core/src/client.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ mod request_handler;
2929
mod timeout_monitor;
3030
mod weak;
3131

32-
use crate::client::weak::WeakClient;
3332
pub use connector::{ConnectRequest, Connector};
3433
pub use handshaker::{DoHandshakeRequest, HandshakeError, HandshakerBuilder};
34+
pub use weak::WeakClient;
3535

3636
/// An internal identifier for a given peer, will be their address if known
3737
/// or a random u128 if not.
@@ -131,6 +131,12 @@ impl<Z: NetworkZone> Client<Z> {
131131
.into()
132132
}
133133

134+
pub fn alive(&self) -> bool {
135+
!(self.error.try_get_err().is_some()
136+
|| self.connection_handle.is_finished()
137+
|| self.timeout_handle.is_finished())
138+
}
139+
134140
pub fn downgrade(&self) -> WeakClient<Z> {
135141
WeakClient {
136142
info: self.info.clone(),

p2p/p2p/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@ monero-serai = { workspace = true, features = ["std"] }
2121
tower = { workspace = true, features = ["buffer"] }
2222
tokio = { workspace = true, features = ["rt", "rt-multi-thread"] }
2323
rayon = { workspace = true }
24-
tokio-util = { workspace = true }
2524
tokio-stream = { workspace = true, features = ["sync", "time"] }
2625
futures = { workspace = true, features = ["std"] }
2726
pin-project = { workspace = true }
28-
dashmap = { workspace = true }
27+
indexmap = { workspace = true }
2928

3029
thiserror = { workspace = true }
3130
bytes = { workspace = true, features = ["std"] }

0 commit comments

Comments
 (0)