Skip to content

Commit

Permalink
chore: add missing builder functions (#4770)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Sep 25, 2023
1 parent 371388d commit 272f062
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions crates/net/network/src/peers/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 272f062

Please sign in to comment.