mirror of
https://github.com/monero-project/monero.git
synced 2025-08-08 08:12:20 -04:00
DRY refactoring
This commit is contained in:
parent
72b5f37f58
commit
9ac2ad0744
3 changed files with 14 additions and 2 deletions
|
@ -751,7 +751,7 @@ difficulty_type Blockchain::get_difficulty_for_next_block()
|
|||
m_timestamps = timestamps;
|
||||
m_difficulties = difficulties;
|
||||
}
|
||||
size_t target = get_current_hard_fork_version() < 2 ? DIFFICULTY_TARGET_V1 : DIFFICULTY_TARGET_V2;
|
||||
size_t target = get_difficulty_target();
|
||||
return next_difficulty(timestamps, difficulties, target);
|
||||
}
|
||||
//------------------------------------------------------------------
|
||||
|
@ -4075,6 +4075,11 @@ bool Blockchain::get_hard_fork_voting_info(uint8_t version, uint32_t &window, ui
|
|||
return m_hardfork->get_voting_info(version, window, votes, threshold, earliest_height, voting);
|
||||
}
|
||||
|
||||
uint64_t Blockchain::get_difficulty_target() const
|
||||
{
|
||||
return get_current_hard_fork_version() < 2 ? DIFFICULTY_TARGET_V1 : DIFFICULTY_TARGET_V2;
|
||||
}
|
||||
|
||||
std::map<uint64_t, std::tuple<uint64_t, uint64_t, uint64_t>> Blockchain:: get_output_histogram(const std::vector<uint64_t> &amounts, bool unlocked, uint64_t recent_cutoff) const
|
||||
{
|
||||
return m_db->get_output_histogram(amounts, unlocked, recent_cutoff);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue