Miner tweaks (#1797)

* Mining fixes.

- Use queue to determine whether we're mining
- Kick stale hash rates

Fixes #1794
Fixes #1641

* Fix tests.

* Address grumbles.
This commit is contained in:
Gav Wood
2016-08-02 17:53:32 +01:00
committed by GitHub
parent 1b507e0147
commit 9de579366a
11 changed files with 72 additions and 46 deletions

View File

@@ -71,6 +71,9 @@ impl<T> UsingQueue<T> where T: Clone {
self.pending = Some(b);
}
/// Is there anything in the queue currently?
pub fn is_in_use(&self) -> bool { self.in_use.len() > 0 }
/// Clears everything; the queue is entirely reset.
pub fn reset(&mut self) {
self.pending = None;