ethereum/cpp-ethereum — pull request #304 by giact (2014-09-12 21:36:32+00:00)
Title: Fixed non-force mining with the new Miner class

When mining without "force mining", `Miner::work()` would not react to new pending transactions.

This because `m_pendingCount` is checked before the code has any chance to actually populate `m_mineState` and write the number of pending transactions to `m_pendingCount`.

I solved this by adding a new state (`Waiting`) that represents the miner waiting to be invoked for new pending transactions
If, after getting switched to `Preparing`, it detects no pending transactions, it switches back to `Waiting`.

In the process, I removed `m_pendingCount` since now it never gets read.

***

Switching force mining on/off would not wake up the `Miner` class.
Reimplemented `Client::setForceMining` to do that.
(I imitated the behaviour of similar functions and wrapped it around `if (!m_extHost.lock())`)