From 0b811767ee6876cf72d91ff7df11ed6945b57e6b Mon Sep 17 00:00:00 2001 From: Wei Tang Date: Fri, 21 Jun 2019 00:19:29 +0200 Subject: [PATCH] Move Engine::register_client to be before other I/O handler registration --- ethcore/light/src/client/service.rs | 3 +-- ethcore/service/src/service.rs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ethcore/light/src/client/service.rs b/ethcore/light/src/client/service.rs index 9672974fc25..cb89659536b 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 17690805642..60caefe9a74 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,