Miner tweaks (#1797) (#1862)

* 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.

* Fixed tests
This commit is contained in:
Arkadiy Paronyan
2016-08-08 11:50:58 +02:00
committed by GitHub
parent 801cf6fcba
commit 78825dcd59
10 changed files with 71 additions and 46 deletions

View File

@@ -70,6 +70,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;