diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-05-01 19:57:34 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-05-01 19:58:09 +0000 |
commit | e9809382109765ce53fcbd95e1fc593d9b19e184 (patch) | |
tree | f79bcb4fd4f14e9b262f67c70b4181f6df86b5eb /tests/unit_tests | |
parent | Merge pull request #5486 (diff) | |
download | monero-e9809382109765ce53fcbd95e1fc593d9b19e184.tar.xz |
fix wide difficulty conversion with some versions of boost
Diffstat (limited to '')
-rw-r--r-- | tests/unit_tests/difficulty.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/unit_tests/difficulty.cpp b/tests/unit_tests/difficulty.cpp index 090fecc84..a732e6969 100644 --- a/tests/unit_tests/difficulty.cpp +++ b/tests/unit_tests/difficulty.cpp @@ -42,13 +42,13 @@ static crypto::hash MKHASH(uint64_t high, uint64_t low) hash_target = (hash_target << 64) | low; boost::multiprecision::uint256_t hash_value = std::numeric_limits<boost::multiprecision::uint256_t>::max() / hash_target; crypto::hash h; - ((uint64_t*)&h)[0] = hash_value.convert_to<uint64_t>(); + ((uint64_t*)&h)[0] = (hash_value & 0xffffffffffffffff).convert_to<uint64_t>(); hash_value >>= 64; - ((uint64_t*)&h)[1] = hash_value.convert_to<uint64_t>(); + ((uint64_t*)&h)[1] = (hash_value & 0xffffffffffffffff).convert_to<uint64_t>(); hash_value >>= 64; - ((uint64_t*)&h)[2] = hash_value.convert_to<uint64_t>(); + ((uint64_t*)&h)[2] = (hash_value & 0xffffffffffffffff).convert_to<uint64_t>(); hash_value >>= 64; - ((uint64_t*)&h)[3] = hash_value.convert_to<uint64_t>(); + ((uint64_t*)&h)[3] = (hash_value & 0xffffffffffffffff).convert_to<uint64_t>(); return h; } |