Correct discovery address CLI functionality (#818)

* Improve handling of discovery IP address CLI config

* Remove excess debug logging

* Add reviewers suggestions
This commit is contained in:
Age Manning
2020-01-23 17:31:08 +11:00
committed by GitHub
parent fdb6e28f94
commit 8c96739cab
4 changed files with 22 additions and 15 deletions

View File

@@ -20,8 +20,9 @@ pub struct Config {
/// The TCP port that libp2p listens on.
pub libp2p_port: u16,
/// The address to broadcast to peers about which address we are listening on.
pub discovery_address: std::net::IpAddr,
/// The address to broadcast to peers about which address we are listening on. None indicates
/// that no discovery address has been set in the CLI args.
pub discovery_address: Option<std::net::IpAddr>,
/// UDP port that discovery listens on.
pub discovery_port: u16,
@@ -86,7 +87,7 @@ impl Default for Config {
network_dir,
listen_address: "127.0.0.1".parse().expect("valid ip address"),
libp2p_port: 9000,
discovery_address: "127.0.0.1".parse().expect("valid ip address"),
discovery_address: None,
discovery_port: 9000,
max_peers: 10,
secret_key_hex: None,