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
@@ -294,7 +294,7 @@ pub 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(),
@@ -555,6 +555,8 @@ pub fn new_full<RuntimeApi, Executor>(
)?;
}
network_starter.start_network();
handles.polkadot_network = Some(polkadot_network_service);
Ok((task_manager, client, handles, network, rpc_handlers))
}
@@ -620,7 +622,7 @@ fn new_light<Runtime, Dispatch>(mut config: Configuration) -> Result<(TaskManage
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(),
@@ -658,6 +660,8 @@ fn new_light<Runtime, Dispatch>(mut config: Configuration) -> Result<(TaskManage
system_rpc_tx,
})?;
network_starter.start_network();
Ok((task_manager, rpc_handlers))
}