refactor checkpoint
This commit is contained in:
@@ -130,11 +130,7 @@ fn do_clap_matches(default_config_path: &OsStr) -> Result<clap::ArgMatches, clap
|
||||
.value_name("BOOTSTRAP_NODE_LIST")
|
||||
.help("Specify a list of bootstrap node dialinfos to use"),
|
||||
)
|
||||
.arg(
|
||||
Arg::new("local")
|
||||
.long("local")
|
||||
.help("Enable local peer scope")
|
||||
);
|
||||
;
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
let matches = matches.arg(
|
||||
@@ -218,9 +214,6 @@ pub fn process_command_line() -> EyreResult<(Settings, ArgMatches)> {
|
||||
if matches.is_present("attach") {
|
||||
settingsrw.auto_attach = !matches!(matches.value_of("attach"), Some("true"));
|
||||
}
|
||||
if matches.is_present("local") {
|
||||
settingsrw.core.network.enable_local_peer_scope = true;
|
||||
}
|
||||
if matches.occurrences_of("delete-protected-store") != 0 {
|
||||
settingsrw.core.protected_store.delete = true;
|
||||
}
|
||||
|
@@ -99,7 +99,6 @@ core:
|
||||
upnp: true
|
||||
natpmp: false
|
||||
detect_address_changes: true
|
||||
enable_local_peer_scope: false
|
||||
restricted_nat_retries: 0
|
||||
tls:
|
||||
certificate_path: '%CERTIFICATE_PATH%'
|
||||
@@ -589,7 +588,6 @@ pub struct Network {
|
||||
pub upnp: bool,
|
||||
pub natpmp: bool,
|
||||
pub detect_address_changes: bool,
|
||||
pub enable_local_peer_scope: bool,
|
||||
pub restricted_nat_retries: u32,
|
||||
pub tls: Tls,
|
||||
pub application: Application,
|
||||
@@ -976,7 +974,6 @@ impl Settings {
|
||||
set_config_value!(inner.core.network.upnp, value);
|
||||
set_config_value!(inner.core.network.natpmp, value);
|
||||
set_config_value!(inner.core.network.detect_address_changes, value);
|
||||
set_config_value!(inner.core.network.enable_local_peer_scope, value);
|
||||
set_config_value!(inner.core.network.restricted_nat_retries, value);
|
||||
set_config_value!(inner.core.network.tls.certificate_path, value);
|
||||
set_config_value!(inner.core.network.tls.private_key_path, value);
|
||||
@@ -1177,9 +1174,6 @@ impl Settings {
|
||||
"network.detect_address_changes" => {
|
||||
Ok(Box::new(inner.core.network.detect_address_changes))
|
||||
}
|
||||
"network.enable_local_peer_scope" => {
|
||||
Ok(Box::new(inner.core.network.enable_local_peer_scope))
|
||||
}
|
||||
"network.restricted_nat_retries" => {
|
||||
Ok(Box::new(inner.core.network.restricted_nat_retries))
|
||||
}
|
||||
@@ -1503,7 +1497,6 @@ mod tests {
|
||||
assert_eq!(s.core.network.upnp, true);
|
||||
assert_eq!(s.core.network.natpmp, false);
|
||||
assert_eq!(s.core.network.detect_address_changes, true);
|
||||
assert_eq!(s.core.network.enable_local_peer_scope, false);
|
||||
assert_eq!(s.core.network.restricted_nat_retries, 0u32);
|
||||
//
|
||||
assert_eq!(
|
||||
|
Reference in New Issue
Block a user