mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 15:47:58 +00:00
Split peer slots between full and light nodes (#10688)
* Split peer slots between full and light nodes * Rustfmt * Oops, accidentally removed a comma * Remove else
This commit is contained in:
@@ -86,9 +86,12 @@ pub struct NetworkParams {
|
||||
#[structopt(long = "out-peers", value_name = "COUNT", default_value = "25")]
|
||||
pub out_peers: u32,
|
||||
|
||||
/// Specify the maximum number of incoming connections we're accepting.
|
||||
/// Maximum number of inbound full nodes peers.
|
||||
#[structopt(long = "in-peers", value_name = "COUNT", default_value = "25")]
|
||||
pub in_peers: u32,
|
||||
/// Maximum number of inbound light nodes peers.
|
||||
#[structopt(long = "in-peers-light", value_name = "COUNT", default_value = "100")]
|
||||
pub in_peers_light: u32,
|
||||
|
||||
/// Disable mDNS discovery.
|
||||
///
|
||||
@@ -203,7 +206,7 @@ impl NetworkParams {
|
||||
boot_nodes,
|
||||
net_config_path,
|
||||
default_peers_set: SetConfig {
|
||||
in_peers: self.in_peers,
|
||||
in_peers: self.in_peers + self.in_peers_light,
|
||||
out_peers: self.out_peers,
|
||||
reserved_nodes: self.reserved_nodes.clone(),
|
||||
non_reserved_mode: if self.reserved_only {
|
||||
@@ -212,6 +215,7 @@ impl NetworkParams {
|
||||
NonReservedPeerMode::Accept
|
||||
},
|
||||
},
|
||||
default_peers_set_num_full: self.in_peers + self.out_peers,
|
||||
listen_addresses,
|
||||
public_addresses,
|
||||
extra_sets: Vec::new(),
|
||||
|
||||
Reference in New Issue
Block a user