diff options
| author | Riccardo Spagni <ric@spagni.net> | 2017-02-02 18:16:38 +0200 |
|---|---|---|
| committer | Riccardo Spagni <ric@spagni.net> | 2017-02-02 18:16:39 +0200 |
| commit | f9e60dcd551b9f5b4a86a730d0abfc97a6767519 (patch) | |
| tree | e1613849aa7a66b11876a03b081c4cc4f6450ca8 /src/cryptonote_core/blockchain.cpp | |
| parent | 05de1bc398178decc6a46c0b4a0da3975339cc89 (diff) | |
| parent | 0644eed7728d3b5146ca7b53f7c50a56b02b327b (diff) | |
| download | monzero-core-f9e60dcd551b9f5b4a86a730d0abfc97a6767519.tar.gz monzero-core-f9e60dcd551b9f5b4a86a730d0abfc97a6767519.tar.xz monzero-core-f9e60dcd551b9f5b4a86a730d0abfc97a6767519.zip | |
Merge pull request #1617
0644eed7 Remove boost/foreach.cpp includes (Miguel Herranz)
36dd3e23 Replace BOOST_REVERSE_FOREACH with ranged for (Miguel Herranz)
629e3101 Replace BOOST_FOREACH with C++11 ranged for (Miguel Herranz)
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
| -rw-r--r-- | src/cryptonote_core/blockchain.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 789687ce0..b344c5597 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -31,6 +31,7 @@ #include <algorithm> #include <cstdio> #include <boost/filesystem.hpp> +#include <boost/range/adaptor/reversed.hpp> #include "include_base_utils.h" #include "cryptonote_basic_impl.h" @@ -933,7 +934,7 @@ difficulty_type Blockchain::get_next_difficulty_for_alternative_chain(const std: size_t count = 0; size_t max_i = timestamps.size()-1; // get difficulties and timestamps from most recent blocks in alt chain - BOOST_REVERSE_FOREACH(auto it, alt_chain) + for(auto it: boost::adaptors::reverse(alt_chain)) { timestamps[max_i - count] = it->second.bl.timestamp; cumulative_difficulties[max_i - count] = it->second.cumulative_difficulty; |
