mirror of
https://github.com/monero-project/monero.git
synced 2025-12-14 01:13:13 +01:00
Merge pull request #9935
69345dbwallet2: use nearest checkpoint to allow fast_refresh on old accounts (Oscar Mira)edc447echeckpoints: support nearest lower checkpoint lookup (Oscar Mira)
This commit is contained in:
@@ -158,6 +158,19 @@ namespace cryptonote
|
||||
return m_points.rbegin()->first;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
uint64_t checkpoints::get_nearest_checkpoint_height(uint64_t block_height) const
|
||||
{
|
||||
if (m_points.empty())
|
||||
return 0;
|
||||
|
||||
auto it = m_points.upper_bound(block_height);
|
||||
if (it == m_points.begin())
|
||||
return 0;
|
||||
|
||||
--it;
|
||||
return it->first;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
const std::map<uint64_t, crypto::hash>& checkpoints::get_points() const
|
||||
{
|
||||
return m_points;
|
||||
|
||||
Reference in New Issue
Block a user