diff --git a/nano/node/bounded_backlog.cpp b/nano/node/bounded_backlog.cpp index 094cf219a9..71f6536749 100644 --- a/nano/node/bounded_backlog.cpp +++ b/nano/node/bounded_backlog.cpp @@ -485,11 +485,9 @@ std::deque nano::backlog_index::next (nano::block_hash last, s auto it = blocks.get ().upper_bound (last); auto end = blocks.get ().end (); - while (it != end && results.size () < count) + for (; it != end && results.size () < count; ++it) { results.push_back (it->hash); - last = it->hash; - it = blocks.get ().upper_bound (last); } return results; }