Remove the NetworkChan from the OnDemandService (#2561)

This commit is contained in:
Pierre Krieger
2019-05-13 20:55:27 +02:00
committed by Gavin Wood
parent 7fb3dc5f68
commit 2724cdac33
3 changed files with 142 additions and 72 deletions
+4 -6
View File
@@ -199,12 +199,10 @@ impl<Components: components::Components> Service<Components> {
};
let has_bootnodes = !network_params.network_config.boot_nodes.is_empty();
let (network, network_chan) = network::Service::new(
network_params,
protocol_id,
import_queue
)?;
on_demand.map(|on_demand| on_demand.set_network_sender(network_chan));
let network = network::Service::new(network_params, protocol_id, import_queue)?;
if let Some(on_demand) = on_demand.as_ref() {
on_demand.set_network_interface(Box::new(Arc::downgrade(&network)));
}
let inherents_pool = Arc::new(InherentsPool::default());
let offchain_workers = if config.offchain_worker {