From 7aeb5035476c672e4c329c02b20ced1669ebe4cd Mon Sep 17 00:00:00 2001 From: Lee Clagett Date: Sun, 31 May 2020 21:18:11 -0400 Subject: Fix boost <1.60 compilation and fix boost 1.73+ warnings --- src/checkpoints/checkpoints.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/checkpoints/checkpoints.cpp') 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 #include 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& checkpoints::get_points() const -- cgit v1.2.3