mirror of
https://github.com/Cuprate/cuprate.git
synced 2024-11-16 15:58:17 +00:00
doc updates
This commit is contained in:
parent
42f74c76c4
commit
1e83064f63
4 changed files with 26 additions and 19 deletions
|
@ -1,10 +1,10 @@
|
|||
use futures::channel::oneshot;
|
||||
use std::sync::Mutex;
|
||||
use std::{
|
||||
fmt::{Debug, Display, Formatter},
|
||||
sync::Arc,
|
||||
sync::{Arc, Mutex},
|
||||
task::{ready, Context, Poll},
|
||||
};
|
||||
|
||||
use futures::channel::oneshot;
|
||||
use tokio::{
|
||||
sync::{mpsc, OwnedSemaphorePermit, Semaphore},
|
||||
task::JoinHandle,
|
||||
|
@ -14,6 +14,8 @@ use tower::{Service, ServiceExt};
|
|||
use tracing::Instrument;
|
||||
|
||||
use cuprate_helper::asynch::InfallibleOneshotReceiver;
|
||||
use cuprate_pruning::PruningSeed;
|
||||
use cuprate_wire::CoreSyncData;
|
||||
|
||||
use crate::{
|
||||
handles::{ConnectionGuard, ConnectionHandle},
|
||||
|
@ -27,8 +29,6 @@ mod request_handler;
|
|||
mod timeout_monitor;
|
||||
|
||||
pub use connector::{ConnectRequest, Connector};
|
||||
use cuprate_pruning::PruningSeed;
|
||||
use cuprate_wire::CoreSyncData;
|
||||
pub use handshaker::{DoHandshakeRequest, HandshakeError, HandshakerBuilder};
|
||||
|
||||
/// An internal identifier for a given peer, will be their address if known
|
||||
|
|
|
@ -4,15 +4,15 @@
|
|||
//! to complete a handshake with them.
|
||||
//!
|
||||
//! This module also contains a [`ping`] function that can be used to check if an address is reachable.
|
||||
use futures::{FutureExt, SinkExt, Stream, StreamExt};
|
||||
use std::sync::Mutex;
|
||||
use std::{
|
||||
future::Future,
|
||||
marker::PhantomData,
|
||||
pin::Pin,
|
||||
sync::Arc,
|
||||
sync::{Arc, Mutex},
|
||||
task::{Context, Poll},
|
||||
};
|
||||
|
||||
use futures::{FutureExt, SinkExt, Stream, StreamExt};
|
||||
use tokio::{
|
||||
sync::{mpsc, OwnedSemaphorePermit, Semaphore},
|
||||
time::{error::Elapsed, timeout},
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
use std::{
|
||||
fmt::{Debug, Formatter},
|
||||
future::Future,
|
||||
pin::Pin,
|
||||
sync::{Arc, Mutex},
|
||||
task::{Context, Poll},
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
use futures::{FutureExt, StreamExt};
|
||||
use indexmap::IndexMap;
|
||||
use monero_serai::{
|
||||
|
@ -5,15 +14,6 @@ use monero_serai::{
|
|||
transaction::{Input, Timelock, Transaction, TransactionPrefix},
|
||||
};
|
||||
use proptest::{collection::vec, prelude::*};
|
||||
use std::sync::Mutex;
|
||||
use std::{
|
||||
fmt::{Debug, Formatter},
|
||||
future::Future,
|
||||
pin::Pin,
|
||||
sync::Arc,
|
||||
task::{Context, Poll},
|
||||
time::Duration,
|
||||
};
|
||||
use tokio::time::timeout;
|
||||
use tower::{service_fn, Service};
|
||||
|
||||
|
@ -24,8 +24,10 @@ use cuprate_p2p_core::{
|
|||
};
|
||||
use cuprate_pruning::PruningSeed;
|
||||
use cuprate_types::{BlockCompleteEntry, TransactionBlobs};
|
||||
use cuprate_wire::protocol::{ChainResponse, GetObjectsResponse};
|
||||
use cuprate_wire::CoreSyncData;
|
||||
use cuprate_wire::{
|
||||
protocol::{ChainResponse, GetObjectsResponse},
|
||||
CoreSyncData,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
block_downloader::{download_blocks, BlockDownloaderConfig, ChainSvcRequest, ChainSvcResponse},
|
||||
|
|
|
@ -128,6 +128,11 @@ impl<N: NetworkZone> ClientPool<N> {
|
|||
peers.iter().filter_map(|peer| self.borrow_client(peer))
|
||||
}
|
||||
|
||||
/// Borrows all [`Client`]s from the pool that have claimed a higher cumulative difficulty than
|
||||
/// the amount passed in.
|
||||
///
|
||||
/// The [`Client`]s are wrapped in [`ClientPoolDropGuard`] which
|
||||
/// will return the clients to the pool when they are dropped.
|
||||
pub fn clients_with_more_cumulative_difficulty(
|
||||
self: &Arc<Self>,
|
||||
cumulative_difficulty: u128,
|
||||
|
|
Loading…
Reference in a new issue