Fix work-notify. (#9104)

This commit is contained in:
Tomasz Drwięga 2018-07-13 12:36:58 +02:00 committed by André Silva
parent 441cb7980b
commit 82a6a0848a
3 changed files with 12 additions and 12 deletions

View File

@ -32,7 +32,7 @@ futures-cpupool = "0.1"
fdlimit = "0.1" fdlimit = "0.1"
ctrlc = { git = "https://github.com/paritytech/rust-ctrlc.git" } ctrlc = { git = "https://github.com/paritytech/rust-ctrlc.git" }
jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" } jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" }
ethcore = { path = "ethcore", features = ["work-notify", "price-info", "stratum"] } ethcore = { path = "ethcore", features = ["parity"] }
parity-bytes = { git = "https://github.com/paritytech/parity-common" } parity-bytes = { git = "https://github.com/paritytech/parity-common" }
ethcore-io = { path = "util/io" } ethcore-io = { path = "util/io" }
ethcore-light = { path = "ethcore/light" } ethcore-light = { path = "ethcore/light" }

View File

@ -80,6 +80,13 @@ tempdir = "0.3"
trie-standardmap = { git = "https://github.com/paritytech/parity-common" } trie-standardmap = { git = "https://github.com/paritytech/parity-common" }
[features] [features]
parity = ["work-notify", "price-info", "stratum"]
# Large optional features that are enabled by default for Parity,
# but might be omitted for other dependent crates.
work-notify = ["ethcore-miner/work-notify"]
price-info = ["ethcore-miner/price-info"]
stratum = ["ethcore-stratum"]
# Display EVM debug traces. # Display EVM debug traces.
evm-debug = ["evm/evm-debug"] evm-debug = ["evm/evm-debug"]
# Display EVM debug traces when running tests. # Display EVM debug traces when running tests.
@ -97,6 +104,3 @@ test-heavy = []
benches = [] benches = []
# Compile test helpers # Compile test helpers
test-helpers = ["tempdir"] test-helpers = ["tempdir"]
work-notify = ["ethcore-miner/work-notify"]
price-info = ["ethcore-miner/price-info"]
stratum = ["ethcore-stratum"]

View File

@ -33,7 +33,6 @@ use ethcore_logger::{Config as LogConfig, RotatingLogger};
use ethcore_service::ClientService; use ethcore_service::ClientService;
use ethereum_types::Address; use ethereum_types::Address;
use sync::{self, SyncConfig}; use sync::{self, SyncConfig};
#[cfg(feature = "work-notify")]
use miner::work_notify::WorkPoster; use miner::work_notify::WorkPoster;
use futures::IntoFuture; use futures::IntoFuture;
use futures_cpupool::CpuPool; use futures_cpupool::CpuPool;
@ -511,14 +510,11 @@ fn execute_impl<Cr, Rr>(cmd: RunCmd, logger: Arc<RotatingLogger>, on_client_rq:
miner.set_gas_range_target(cmd.miner_extras.gas_range_target); miner.set_gas_range_target(cmd.miner_extras.gas_range_target);
miner.set_extra_data(cmd.miner_extras.extra_data); miner.set_extra_data(cmd.miner_extras.extra_data);
#[cfg(feature = "work-notify")]
{
if !cmd.miner_extras.work_notify.is_empty() { if !cmd.miner_extras.work_notify.is_empty() {
miner.add_work_listener(Box::new( miner.add_work_listener(Box::new(
WorkPoster::new(&cmd.miner_extras.work_notify, fetch.clone(), event_loop.remote()) WorkPoster::new(&cmd.miner_extras.work_notify, fetch.clone(), event_loop.remote())
)); ));
} }
}
let engine_signer = cmd.miner_extras.engine_signer; let engine_signer = cmd.miner_extras.engine_signer;
if engine_signer != Default::default() { if engine_signer != Default::default() {