forked from lthn/blockchain
get_checkpoint_before_height() fixed (rare case in gcc when CPs < 3)
This commit is contained in:
parent
5f0b5f8f55
commit
e99d4ad8e2
1 changed files with 2 additions and 2 deletions
|
|
@ -87,8 +87,8 @@ namespace currency
|
|||
return top_cp;
|
||||
|
||||
auto it = m_points.lower_bound(height); // if found, it->first >= height
|
||||
if (it == m_points.end() || --it == m_points.end())
|
||||
if (it == m_points.end() || it == m_points.begin())
|
||||
return 0;
|
||||
return it->first;
|
||||
return (--it)->first;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue