a few more docs

This commit is contained in:
Boog900 2024-04-29 01:11:54 +01:00
parent 43001760aa
commit 75a1db3fdc
No known key found for this signature in database
GPG key ID: 42AB1287CB0041C2
2 changed files with 5 additions and 0 deletions

View file

@ -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, _)| {

View file

@ -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).