Delayed UPnP initialization

This commit is contained in:
arkpar
2016-02-23 19:38:06 +01:00
parent 6fe189cbd9
commit 8beba717f8
3 changed files with 84 additions and 59 deletions

View File

@@ -73,7 +73,7 @@ Options:
--address URL Equivalent to --listen-address URL --public-address URL.
--peers NUM Try to manintain that many peers [default: 25].
--no-discovery Disable new peer discovery.
--upnp Use UPnP to try to figure out the correct network settings.
--no-upnp Disable trying to figure out the correct public adderss over UPnP.
--node-key KEY Specify node secret key, either as 64-character hex string or input to SHA3 operation.
--cache-pref-size BYTES Specify the prefered size of the blockchain cache in bytes [default: 16384].
@@ -101,7 +101,7 @@ struct Args {
flag_address: Option<String>,
flag_peers: u32,
flag_no_discovery: bool,
flag_upnp: bool,
flag_no_upnp: bool,
flag_node_key: Option<String>,
flag_cache_pref_size: usize,
flag_cache_max_size: usize,
@@ -233,7 +233,7 @@ impl Configuration {
fn net_settings(&self, spec: &Spec) -> NetworkConfiguration {
let mut ret = NetworkConfiguration::new();
ret.nat_enabled = self.args.flag_upnp;
ret.nat_enabled = !self.args.flag_no_upnp;
ret.boot_nodes = self.init_nodes(spec);
let (listen, public) = self.net_addresses();
ret.listen_address = listen;