diff --git a/ethcore/light/src/client/service.rs b/ethcore/light/src/client/service.rs index 9672974fc..cb8965953 100644 --- a/ethcore/light/src/client/service.rs +++ b/ethcore/light/src/client/service.rs @@ -75,9 +75,8 @@ impl Service { io_service.channel(), cache, )?); - - io_service.register_handler(Arc::new(ImportBlocks(client.clone()))).map_err(Error::Io)?; spec.engine.register_client(Arc::downgrade(&client) as _); + io_service.register_handler(Arc::new(ImportBlocks(client.clone()))).map_err(Error::Io)?; Ok(Service { client, diff --git a/ethcore/service/src/service.rs b/ethcore/service/src/service.rs index 176908056..60caefe9a 100644 --- a/ethcore/service/src/service.rs +++ b/ethcore/service/src/service.rs @@ -113,6 +113,7 @@ impl ClientService { miner.clone(), io_service.channel(), )?; + spec.engine.register_client(Arc::downgrade(&client) as _); miner.set_io_channel(io_service.channel()); miner.set_in_chain_checker(&client.clone()); @@ -148,8 +149,6 @@ impl ClientService { }); io_service.register_handler(client_io)?; - spec.engine.register_client(Arc::downgrade(&client) as _); - Ok(ClientService { io_service: Arc::new(io_service), client: client,