Merge pull request #5510

e9809382 fix wide difficulty conversion with some versions of boost (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2019-05-07 17:36:27 +02:00
commit f64f59627d
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
11 changed files with 25 additions and 25 deletions

View file

@ -437,7 +437,7 @@ namespace rpc
auto& chain = m_core.get_blockchain_storage();
res.info.wide_difficulty = chain.get_difficulty_for_next_block();
res.info.difficulty = (res.info.wide_difficulty << 64 >> 64).convert_to<uint64_t>();
res.info.difficulty = (res.info.wide_difficulty & 0xffffffffffffffff).convert_to<uint64_t>();
res.info.target = chain.get_difficulty_target();
@ -459,7 +459,7 @@ namespace rpc
res.info.testnet = m_core.get_nettype() == TESTNET;
res.info.stagenet = m_core.get_nettype() == STAGENET;
res.info.wide_cumulative_difficulty = m_core.get_blockchain_storage().get_db().get_block_cumulative_difficulty(res.info.height - 1);
res.info.cumulative_difficulty = (res.info.wide_cumulative_difficulty << 64 >> 64).convert_to<uint64_t>();
res.info.cumulative_difficulty = (res.info.wide_cumulative_difficulty & 0xffffffffffffffff).convert_to<uint64_t>();
res.info.block_size_limit = res.info.block_weight_limit = m_core.get_blockchain_storage().get_current_cumulative_block_weight_limit();
res.info.block_size_median = res.info.block_weight_median = m_core.get_blockchain_storage().get_current_cumulative_block_weight_median();
res.info.start_time = (uint64_t)m_core.get_start_time();
@ -829,7 +829,7 @@ namespace rpc
}
header.wide_difficulty = m_core.get_blockchain_storage().block_difficulty(header.height);
header.difficulty = (header.wide_difficulty << 64 >> 64).convert_to<uint64_t>();
header.difficulty = (header.wide_difficulty & 0xffffffffffffffff).convert_to<uint64_t>();
return true;
}