33 throw InvalidSealEngine();
40 throw InvalidSealEngine();
45 EthashClient::EthashClient(
49 std::shared_ptr<GasPricer> _gpForAdoption,
50 std::string
const& _dbPath,
54 Client(_params, _networkID, _host, _gpForAdoption, _dbPath, _forceAction, _limits)
93 return std::tuple<h256, h256, h256>();
114 bytes falseBytes {0};
129 if (chrono::steady_clock::now() - i->second.second > chrono::seconds(5))
132 ret += i++->second.first;
DEV_SIMPLE_EXCEPTION(ChainParamsNotEthash)
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
BlockHeader m_sealingInfo
The header we're attempting to seal on (derived from m_postSeal).
u256 hashrate() const
The hashrate...
void onPostStateChanged()
Called when the post state has changed (i.e.
EthashClient & asEthashClient(Interface &_c)
SharedMutex x_externalRates
bool shouldServeWork() const
The Host class Capabilities should be registered prior to startNetwork, since m_capabilities is not t...
std::tuple< h256, h256, h256 > getEthashWork()
Update to the latest transactions and get hash of the current block to be mined minus the nonce (the ...
bool submitEthashWork(h256 const &_mixHash, h64 const &_nonce)
Submit the proof for the proof-of-work.
static h256 seedHash(BlockHeader const &_bi)
std::hash for asio::adress
void submitExternalHashrate(u256 const &_rate, h256 const &_id)
void manuallySubmitWork(h256 const &_mixHash, Nonce _nonce)
void setShouldPrecomputeDAG(bool _precompute)
Enable/disable precomputing of the DAG for next epoch.
void manuallySetWork(BlockHeader const &_work)
static h256 boundary(BlockHeader const &_bi)
bool isMining() const
Are we mining now?
std::vector< byte > bytes
Main API hub for interfacing with Ethereum.
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void >> u256
Main API hub for interfacing with Ethereum.
boost::unique_lock< boost::shared_mutex > WriteGuard
Describes the progress of a mining operation.
std::chrono::system_clock::time_point m_lastGetWork
Is there an active and valid remote worker?
std::unordered_map< h256, std::pair< u256, std::chrono::steady_clock::time_point > > m_externalRates
bool setOption(std::string const &_name, bytes const &_value)
virtual SealEngineFace * sealEngine() const
Get the seal engine.
u256 externalHashrate() const
WorkingProgress miningProgress() const
Check the progress of the mining.
SealEngineFace * sealEngine() const override
Get the seal engine.
eth::GenericFarm< EthashProofOfWork > & farm()
bool m_remoteWorking
Has the remote worker recently been reset?