diff --git a/nano/node/vote_cache.cpp b/nano/node/vote_cache.cpp index 63d6f6060..f3eaec23c 100644 --- a/nano/node/vote_cache.cpp +++ b/nano/node/vote_cache.cpp @@ -244,13 +244,12 @@ std::vector nano::vote_cache::top (const nano::uint cleanup (); } - for (auto & entry : cache.get ()) + for (auto & entry : cache) { - if (entry.tally () < min_tally) + if (entry.tally () >= min_tally) { - break; + results.push_back ({ entry.hash (), entry.tally (), entry.final_tally () }); } - results.push_back ({ entry.hash (), entry.tally (), entry.final_tally () }); } } diff --git a/nano/node/vote_cache.hpp b/nano/node/vote_cache.hpp index 06e4481d1..55d1256cf 100644 --- a/nano/node/vote_cache.hpp +++ b/nano/node/vote_cache.hpp @@ -164,7 +164,6 @@ private: // clang-format off class tag_sequenced {}; class tag_hash {}; - class tag_tally {}; // clang-format on // clang-format off @@ -172,9 +171,7 @@ private: mi::indexed_by< mi::hashed_unique, mi::const_mem_fun>, - mi::sequenced>, - mi::ordered_non_unique, - mi::const_mem_fun, std::greater<>> // DESC + mi::sequenced> >>; // clang-format on ordered_cache cache;