Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Move Engine::register_client to be before other I/O handler registration #10767

Merged
merged 1 commit into from
Jun 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions ethcore/light/src/client/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ impl<T: ChainDataFetcher> Service<T> {
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,
Expand Down
3 changes: 1 addition & 2 deletions ethcore/service/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down Expand Up @@ -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,
Expand Down