chore: add missing builder functions (#4770)

This commit is contained in:
Matthias Seitz
2023-09-25 19:55:24 +02:00
committed by GitHub
parent 371388da5d
commit 272f06216a

View File

@ -1155,6 +1155,12 @@ impl PeersConfig {
self
}
/// Configure how long to ban bad peers
pub fn with_ban_duration(mut self, ban_duration: Duration) -> Self {
self.ban_duration = ban_duration;
self
}
/// Maximum occupied slots for outbound connections.
pub fn with_max_pending_outbound(mut self, num_outbound: usize) -> Self {
self.connection_info.num_outbound = num_outbound;
@ -1219,6 +1225,18 @@ impl PeersConfig {
self
}
/// Configures how to weigh reputation changes.
pub fn with_reputation_weights(mut self, reputation_weights: ReputationChangeWeights) -> Self {
self.reputation_weights = reputation_weights;
self
}
/// Configures how long to backoff peers that are we failed to connect to for non-fatal reasons
pub fn with_backoff_durations(mut self, backoff_durations: PeerBackoffDurations) -> Self {
self.backoff_durations = backoff_durations;
self
}
/// Read from file nodes available at launch. Ignored if None.
pub fn with_basic_nodes_from_file(
self,