|
@ -24,7 +24,7 @@ struct MineInfo |
|
|
class Dagger |
|
|
class Dagger |
|
|
{ |
|
|
{ |
|
|
public: |
|
|
public: |
|
|
static h256 eval(h256 const& _root, u256 const& _nonce) { h256 b = (h256)((u256)_root ^ _nonce); return sha3(bytesConstRef((byte const*)&b, 32)); } |
|
|
static h256 eval(h256 const& _root, u256 const& _nonce) { h256 b[2] = { _root, (h256)_nonce }; return sha3(bytesConstRef((byte const*)&b[0], 64)); } |
|
|
static bool verify(h256 const& _root, u256 const& _nonce, u256 const& _difficulty) { return (bigint)(u256)eval(_root, _nonce) <= (bigint(1) << 256) / _difficulty; } |
|
|
static bool verify(h256 const& _root, u256 const& _nonce, u256 const& _difficulty) { return (bigint)(u256)eval(_root, _nonce) <= (bigint(1) << 256) / _difficulty; } |
|
|
|
|
|
|
|
|
MineInfo mine(u256& o_solution, h256 const& _root, u256 const& _difficulty, uint _msTimeout = 100, bool const& _continue = bool(true)); |
|
|
MineInfo mine(u256& o_solution, h256 const& _root, u256 const& _difficulty, uint _msTimeout = 100, bool const& _continue = bool(true)); |
|
|