Make network_config_path an Option (#5661)

* Make network_config_path an Option

* Fix network tests

* Use None as the network config path

* Fix cli

* Don't make PathBuf an Option in a cli context
This commit is contained in:
Ashley
2020-04-17 14:48:45 +02:00
committed by GitHub
parent 249a92aece
commit 95dc400bb8
8 changed files with 20 additions and 19 deletions
+3 -1
View File
@@ -184,7 +184,9 @@ impl<B: BlockT + 'static, H: ExHashT> NetworkWorker<B, H> {
pub fn new(params: Params<B, H>) -> Result<NetworkWorker<B, H>, Error> {
let (to_worker, from_worker) = tracing_unbounded("mpsc_network_worker");
fs::create_dir_all(&params.network_config.net_config_path)?;
if let Some(path) = params.network_config.net_config_path {
fs::create_dir_all(&path)?;
}
// List of multiaddresses that we know in the network.
let mut known_addresses = Vec::new();