mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 07:27:55 +00:00
peerset: fix reserved nodes (#3706)
* peerset: fix handling of reserved only peering mode * core: add cli parameter to enable reserved nodes only * peerset: fix tests * peerset: add test for priority only mode * core: fix reserved only cli flag description * peerset: extend docs on set_priority_only
This commit is contained in:
@@ -550,7 +550,8 @@ fn fill_network_configuration(
|
||||
);
|
||||
config.net_config_path = config.config_path.clone();
|
||||
config.reserved_nodes.extend(cli.reserved_nodes.into_iter());
|
||||
if !config.reserved_nodes.is_empty() {
|
||||
|
||||
if cli.reserved_only {
|
||||
config.non_reserved_mode = NonReservedPeerMode::Deny;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,6 +92,13 @@ pub struct NetworkConfigurationParams {
|
||||
#[structopt(long = "reserved-nodes", value_name = "URL")]
|
||||
pub reserved_nodes: Vec<String>,
|
||||
|
||||
/// Whether to only allow connections to/from reserved nodes.
|
||||
///
|
||||
/// If you are a validator your node might still connect to other validator
|
||||
/// nodes regardless of whether they are defined as reserved nodes.
|
||||
#[structopt(long = "reserved-only")]
|
||||
pub reserved_only: bool,
|
||||
|
||||
/// Listen on this multiaddress.
|
||||
#[structopt(long = "listen-addr", value_name = "LISTEN_ADDR")]
|
||||
pub listen_addr: Vec<String>,
|
||||
|
||||
Reference in New Issue
Block a user