mirror of
https://github.com/monero-project/monero.git
synced 2025-08-17 12:10:20 -04:00
Make difficulty 128 bit instead of 64 bit
Based on Boolberry work by: jahrsg <jahr@jahr.me> cr.zoidberg <crypto.zoidberg@gmail.com>
This commit is contained in:
parent
e4b049da05
commit
91f4c7f45f
30 changed files with 787 additions and 62 deletions
|
@ -436,7 +436,8 @@ namespace rpc
|
|||
|
||||
auto& chain = m_core.get_blockchain_storage();
|
||||
|
||||
res.info.difficulty = chain.get_difficulty_for_next_block();
|
||||
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.target = chain.get_difficulty_target();
|
||||
|
||||
|
@ -457,7 +458,8 @@ namespace rpc
|
|||
res.info.mainnet = m_core.get_nettype() == MAINNET;
|
||||
res.info.testnet = m_core.get_nettype() == TESTNET;
|
||||
res.info.stagenet = m_core.get_nettype() == STAGENET;
|
||||
res.info.cumulative_difficulty = m_core.get_blockchain_storage().get_db().get_block_cumulative_difficulty(res.info.height - 1);
|
||||
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.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();
|
||||
|
@ -826,7 +828,8 @@ namespace rpc
|
|||
header.reward += out.amount;
|
||||
}
|
||||
|
||||
header.difficulty = m_core.get_blockchain_storage().block_difficulty(header.height);
|
||||
header.wide_difficulty = m_core.get_blockchain_storage().block_difficulty(header.height);
|
||||
header.difficulty = (header.wide_difficulty << 64 >> 64).convert_to<uint64_t>();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue