From e9809382109765ce53fcbd95e1fc593d9b19e184 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 1 May 2019 19:57:34 +0000 Subject: fix wide difficulty conversion with some versions of boost --- src/cryptonote_core/blockchain.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cryptonote_core/blockchain.cpp') diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index f733efb2f..3ef20fd0b 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -2324,8 +2324,8 @@ bool Blockchain::find_blockchain_supplement(const std::list& qbloc if (result) { cryptonote::difficulty_type wide_cumulative_difficulty = m_db->get_block_cumulative_difficulty(resp.total_height - 1); - resp.cumulative_difficulty = (wide_cumulative_difficulty << 64 >> 64).convert_to(); - resp.cumulative_difficulty_top64 = (wide_cumulative_difficulty >> 64).convert_to(); + resp.cumulative_difficulty = (wide_cumulative_difficulty & 0xffffffffffffffff).convert_to(); + resp.cumulative_difficulty_top64 = ((wide_cumulative_difficulty >> 64) & 0xffffffffffffffff).convert_to(); } return result; -- cgit v1.2.3