mirror of
https://github.com/Cuprate/cuprate.git
synced 2025-03-12 09:29:11 +00:00
a few more docs
This commit is contained in:
parent
43001760aa
commit
75a1db3fdc
2 changed files with 5 additions and 0 deletions
|
@ -91,6 +91,9 @@ impl<Z: NetworkZone> PeerList<Z> {
|
|||
block_needed: Option<u64>,
|
||||
must_keep_peers: &HashSet<Z::Addr>,
|
||||
) -> Option<ZoneSpecificPeerListEntryBase<Z::Addr>> {
|
||||
// Take a random peer and see if it's in the list of must_keep_peers, if it is try again.
|
||||
// TODO: improve this
|
||||
|
||||
for _ in 0..3 {
|
||||
if let Some(needed_height) = block_needed {
|
||||
let (_, addresses_with_block) = self.pruning_seeds.iter().find(|(seed, _)| {
|
||||
|
|
|
@ -77,7 +77,9 @@ pub struct Client<Z: NetworkZone> {
|
|||
/// The [`JoinHandle`] of the spawned timeout monitor task.
|
||||
timeout_handle: JoinHandle<Result<(), tower::BoxError>>,
|
||||
|
||||
/// The semaphore that limits the requests sent to the peer.
|
||||
semaphore: PollSemaphore,
|
||||
/// A permit for the semaphore, will be some after `poll_ready` returns ready.
|
||||
permit: Option<OwnedSemaphorePermit>,
|
||||
|
||||
/// The error slot shared between the [`Client`] and [`Connection`](connection::Connection).
|
||||
|
|
Loading…
Reference in a new issue