1
0
Fork 0
forked from lthn/blockchain

get_checkpoint_before_height() fixed (rare case in gcc when CPs < 3)

This commit is contained in:
sowle 2021-11-30 00:20:51 +03:00
parent 5f0b5f8f55
commit e99d4ad8e2
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -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;
}
}