aboutsummaryrefslogtreecommitdiff
path: root/src/checkpoints
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2020-06-01 08:52:12 -0500
committerluigi1111 <luigi1111w@gmail.com>2020-06-01 08:52:12 -0500
commit992b7ce30fa101f55314b89aa5bdf20881f5b43d (patch)
tree41562e1722533860750b064f214840578793ee5c /src/checkpoints
parentMerge pull request #6582 (diff)
parentFix boost <1.60 compilation and fix boost 1.73+ warnings (diff)
downloadmonero-992b7ce30fa101f55314b89aa5bdf20881f5b43d.tar.xz
Merge pull request #6612
7aeb503 Fix boost <1.60 compilation and fix boost 1.73+ warnings (vtnerd)
Diffstat (limited to 'src/checkpoints')
-rw-r--r--src/checkpoints/checkpoints.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/checkpoints/checkpoints.cpp b/src/checkpoints/checkpoints.cpp
index 852e21318..7214a3056 100644
--- a/src/checkpoints/checkpoints.cpp
+++ b/src/checkpoints/checkpoints.cpp
@@ -34,6 +34,7 @@
#include "string_tools.h"
#include "storages/portable_storage_template_helper.h" // epee json include
#include "serialization/keyvalue_serialization.h"
+#include <functional>
#include <vector>
using namespace epee;
@@ -133,11 +134,9 @@ namespace cryptonote
//---------------------------------------------------------------------------
uint64_t checkpoints::get_max_height() const
{
- std::map< uint64_t, crypto::hash >::const_iterator highest =
- std::max_element( m_points.begin(), m_points.end(),
- ( boost::bind(&std::map< uint64_t, crypto::hash >::value_type::first, boost::placeholders::_1) <
- boost::bind(&std::map< uint64_t, crypto::hash >::value_type::first, boost::placeholders::_2 ) ) );
- return highest->first;
+ if (m_points.empty())
+ return 0;
+ return m_points.rbegin()->first;
}
//---------------------------------------------------------------------------
const std::map<uint64_t, crypto::hash>& checkpoints::get_points() const