Browse Source

Extra debug information for #1438.

cl-refactor
Gav Wood 10 years ago
parent
commit
fe7788cdee
  1. 16
      libethcore/Ethasher.cpp

16
libethcore/Ethasher.cpp

@ -119,9 +119,21 @@ bool Ethasher::verify(BlockInfo const& _header)
boundary.data());
#if ETH_DEBUG
// should be equivalent to:
auto result = eval(_header);
assert((result.mixHash == _header.mixHash && result.value <= boundary) == ret);
if ((result.value <= boundary && result.mixHash == _header.mixHash) != ret)
{
cwarn << "Assertion failure coming: evaluated result gives different outcome to ethash_quick_check_difficulty";
cwarn << "headerHash:" << _header.headerHash(WithoutNonce);
cwarn << "nonce:" << _header.nonce;
cwarn << "mixHash:" << _header.mixHash;
cwarn << "difficulty:" << _header.difficulty;
cwarn << "boundary:" << boundary;
cwarn << "result.value:" << result.value;
cwarn << "result.mixHash:" << result.mixHash;
}
assert((result.value <= boundary) == ret);
if (result.value <= boundary)
assert(result.mixHash == _header.mixHash);
#endif
return ret;

Loading…
Cancel
Save