Make light client backend only work with locally available data (#3538)

* removing fetcher dependency from light backend

* fix compilation
This commit is contained in:
Svyatoslav Nikolsky
2019-09-12 18:13:26 +03:00
committed by Gavin Wood
parent fd924c07ed
commit 634ca73e50
10 changed files with 267 additions and 563 deletions
+2 -3
View File
@@ -237,9 +237,8 @@ pub fn new_light<C: Send + Default + 'static>(config: Configuration<C, GenesisCo
.with_transaction_pool(|config, client|
Ok(TransactionPool::new(config, transaction_pool::ChainApi::new(client)))
)?
.with_import_queue_and_fprb(|_config, client, backend, _select_chain, transaction_pool| {
let fetch_checker = backend.blockchain().fetcher()
.upgrade()
.with_import_queue_and_fprb(|_config, client, backend, fetcher, _select_chain, transaction_pool| {
let fetch_checker = fetcher
.map(|fetcher| fetcher.checker().clone())
.ok_or_else(|| "Trying to start light import queue without active fetch checker")?;
let block_import = grandpa::light_block_import::<_, _, _, RuntimeApi, _>(