55 std::function<Miner*(typename Miner::ConstructionInfo ci)>
create;
70 if (_wp.headerHash ==
m_work.headerHash)
83 bool start(std::string
const& _sealer)
92 auto ins =
m_sealers[_sealer].instances();
94 for (
unsigned i = 0; i < ins; ++i)
127 p.
ms = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() -
m_lastStart).
count();
131 p.
hashes += i->hashCount();
171 for (std::shared_ptr<Miner>
const& m:
m_miners)
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
std::function< unsigned()> instances
void setSealers(std::map< std::string, SealerDescriptor > const &_sealers)
SolutionFound m_onSolutionFound
WorkingProgress const & miningProgress() const
Get information on the progress of mining this work package.
void stop()
Stop all mining activities.
std::function< bool(Solution const &)> SolutionFound
std::vector< std::shared_ptr< Miner > > m_miners
std::function< Miner *(typename Miner::ConstructionInfo ci)> create
void resetMiningProgress()
Reset the mining progess counter.
std::atomic< bool > m_isMining
void onSolutionFound(SolutionFound const &_handler)
Provides a valid header based upon that received previously with setWork().
typename dev::eth::EthashProofOfWork::WorkPackage WorkPackage
std::map< std::string, SealerDescriptor > m_sealers
#define DEV_READ_GUARDED(MUTEX)
Class for hosting one or more Miners.
uint64_t ms
Total number of milliseconds of mining thus far.
bool start(std::string const &_sealer)
Start a number of miners.
boost::shared_lock< boost::shared_mutex > ReadGuard
typename dev::eth::EthashProofOfWork::Solution Solution
boost::unique_lock< boost::shared_mutex > WriteGuard
std::chrono::steady_clock::time_point m_lastStart
uint64_t hashes
Total number of hashes computed.
Describes the progress of a mining operation.
void setWork(WorkPackage const &_wp)
Sets the current mining mission.
bool submitProof(Solution const &_s, Miner *_m) override
Called from a Miner to note a WorkPackage has a solution.
boost::shared_mutex SharedMutex
clock::time_point time_point
A miner - a member and adoptee of the Farm.
WorkingProgress m_progress