mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
fix wide difficulty conversion with some versions of boost
This commit is contained in:
parent
581994b61c
commit
e980938210
11 changed files with 25 additions and 25 deletions
|
@ -44,13 +44,13 @@ public:
|
|||
difficulty = difficulty_high;
|
||||
difficulty = (difficulty << 64) | difficulty_low;
|
||||
boost::multiprecision::uint256_t hash_value = std::numeric_limits<boost::multiprecision::uint256_t>::max() / hash_target;
|
||||
((uint64_t*)&hash)[0] = (hash_value << 64 >> 64).convert_to<uint64_t>();
|
||||
((uint64_t*)&hash)[0] = (hash_value & 0xffffffffffffffff).convert_to<uint64_t>();
|
||||
hash_value >>= 64;
|
||||
((uint64_t*)&hash)[1] = (hash_value << 64 >> 64).convert_to<uint64_t>();
|
||||
((uint64_t*)&hash)[1] = (hash_value & 0xffffffffffffffff).convert_to<uint64_t>();
|
||||
hash_value >>= 64;
|
||||
((uint64_t*)&hash)[2] = (hash_value << 64 >> 64).convert_to<uint64_t>();
|
||||
((uint64_t*)&hash)[2] = (hash_value & 0xffffffffffffffff).convert_to<uint64_t>();
|
||||
hash_value >>= 64;
|
||||
((uint64_t*)&hash)[3] = (hash_value << 64 >> 64).convert_to<uint64_t>();
|
||||
((uint64_t*)&hash)[3] = (hash_value & 0xffffffffffffffff).convert_to<uint64_t>();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue