mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: add missing builder functions (#4770)
This commit is contained in:
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user