Companion PR to delaying network startup to after initialization (#1547)

This commit is contained in:
Pierre Krieger
2020-08-06 14:30:19 +02:00
committed by GitHub
parent e818944cbe
commit 39ed1a2b99
2 changed files with 12 additions and 4 deletions
+6 -2
View File
@@ -335,7 +335,7 @@ fn new_full<RuntimeApi, Executor>(
let finality_proof_provider =
GrandpaFinalityProofProvider::new_for_service(backend.clone(), client.clone());
let (network, network_status_sinks, system_rpc_tx) =
let (network, network_status_sinks, system_rpc_tx, network_starter) =
service::build_network(service::BuildNetworkParams {
config: &config,
client: client.clone(),
@@ -512,6 +512,8 @@ fn new_full<RuntimeApi, Executor>(
)?;
}
network_starter.start_network();
Ok((task_manager, client))
}
@@ -574,7 +576,7 @@ fn new_light<Runtime, Dispatch>(mut config: Configuration) -> Result<TaskManager
let finality_proof_provider =
GrandpaFinalityProofProvider::new_for_service(backend.clone(), client.clone());
let (network, network_status_sinks, system_rpc_tx) =
let (network, network_status_sinks, system_rpc_tx, network_starter) =
service::build_network(service::BuildNetworkParams {
config: &config,
client: client.clone(),
@@ -612,6 +614,8 @@ fn new_light<Runtime, Dispatch>(mut config: Configuration) -> Result<TaskManager
system_rpc_tx,
})?;
network_starter.start_network();
Ok(task_manager)
}