ensure sealing work enabled if notifier registed
This commit is contained in:
parent
57d718fde1
commit
131aa14afa
@ -234,7 +234,8 @@ pub struct Miner {
|
|||||||
impl Miner {
|
impl Miner {
|
||||||
/// Push notifier that will handle new jobs
|
/// Push notifier that will handle new jobs
|
||||||
pub fn push_notifier(&self, notifier: Box<NotifyWork>) {
|
pub fn push_notifier(&self, notifier: Box<NotifyWork>) {
|
||||||
self.notifiers.write().push(notifier)
|
self.notifiers.write().push(notifier);
|
||||||
|
self.sealing_work.lock().enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates new instance of miner Arc.
|
/// Creates new instance of miner Arc.
|
||||||
|
@ -211,6 +211,8 @@ impl From<AddrParseError> for Error {
|
|||||||
|
|
||||||
impl super::work_notify::NotifyWork for Stratum {
|
impl super::work_notify::NotifyWork for Stratum {
|
||||||
fn notify(&self, pow_hash: H256, difficulty: U256, number: u64) {
|
fn notify(&self, pow_hash: H256, difficulty: U256, number: u64) {
|
||||||
|
trace!(target: "stratum", "Notify work");
|
||||||
|
|
||||||
self.service.push_work_all(
|
self.service.push_work_all(
|
||||||
self.dispatcher.payload(pow_hash, difficulty, number)
|
self.dispatcher.payload(pow_hash, difficulty, number)
|
||||||
).unwrap_or_else(
|
).unwrap_or_else(
|
||||||
|
Loading…
Reference in New Issue
Block a user