ensure sealing work enabled if notifier registed

This commit is contained in:
NikVolf 2017-03-16 03:37:50 +03:00
parent 57d718fde1
commit 131aa14afa
2 changed files with 4 additions and 1 deletions

View File

@ -234,7 +234,8 @@ pub struct Miner {
impl Miner {
/// Push notifier that will handle new jobs
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.

View File

@ -211,6 +211,8 @@ impl From<AddrParseError> for Error {
impl super::work_notify::NotifyWork for Stratum {
fn notify(&self, pow_hash: H256, difficulty: U256, number: u64) {
trace!(target: "stratum", "Notify work");
self.service.push_work_all(
self.dispatcher.payload(pow_hash, difficulty, number)
).unwrap_or_else(