aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_protocol/cryptonote_protocol_handler.inl
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-01-31 10:44:08 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-03-24 21:03:19 +0000
commit91f4c7f45f794fc7bee99356e56853369c98c410 (patch)
treeca5eb5edbdeb83511b12b39f0b534a3090fc76b4 /src/cryptonote_protocol/cryptonote_protocol_handler.inl
parentMerge pull request #5286 (diff)
downloadmonero-91f4c7f45f794fc7bee99356e56853369c98c410.tar.xz
Make difficulty 128 bit instead of 64 bit
Based on Boolberry work by: jahrsg <jahr@jahr.me> cr.zoidberg <crypto.zoidberg@gmail.com>
Diffstat (limited to '')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
index b33867e8b..32f0afceb 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -398,7 +398,9 @@ namespace cryptonote
{
m_core.get_blockchain_top(hshd.current_height, hshd.top_id);
hshd.top_version = m_core.get_ideal_hard_fork_version(hshd.current_height);
- hshd.cumulative_difficulty = m_core.get_block_cumulative_difficulty(hshd.current_height);
+ difficulty_type wide_cumulative_difficulty = m_core.get_block_cumulative_difficulty(hshd.current_height);
+ hshd.cumulative_difficulty = (wide_cumulative_difficulty << 64 >> 64).convert_to<uint64_t>();
+ hshd.cumulative_difficulty_top64 = (wide_cumulative_difficulty >> 64).convert_to<uint64_t>();
hshd.current_height +=1;
hshd.pruning_seed = m_core.get_blockchain_pruning_seed();
return true;