From dbbab9174315848652199069ed9f0a02964394f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Mon, 26 Sep 2022 17:07:32 +0200 Subject: [PATCH] Replace random_access with sequenced in `active_transactions` (#3957) --- nano/node/active_transactions.cpp | 4 ++-- nano/node/active_transactions.hpp | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/nano/node/active_transactions.cpp b/nano/node/active_transactions.cpp index c64a34cf..787c6aec 100644 --- a/nano/node/active_transactions.cpp +++ b/nano/node/active_transactions.cpp @@ -313,7 +313,7 @@ std::vector> nano::active_transactions::list_act std::vector> result_l; result_l.reserve (std::min (max_a, roots.size ())); { - auto & sorted_roots_l (roots.get ()); + auto & sorted_roots_l (roots.get ()); std::size_t count_l{ 0 }; for (auto i = sorted_roots_l.begin (), n = sorted_roots_l.end (); i != n && count_l < max_a; ++i, ++count_l) { @@ -581,7 +581,7 @@ void nano::active_transactions::erase_oldest () if (!roots.empty ()) { node.stats.inc (nano::stat::type::election, nano::stat::detail::election_drop_overflow); - auto item = roots.get ().front (); + auto item = roots.get ().front (); cleanup_election (lock, item.election); } } diff --git a/nano/node/active_transactions.hpp b/nano/node/active_transactions.hpp index 43f2f976..d3af842c 100644 --- a/nano/node/active_transactions.hpp +++ b/nano/node/active_transactions.hpp @@ -126,9 +126,8 @@ class active_transactions final // clang-format off class tag_account {}; - class tag_random_access {}; class tag_root {}; - class tag_sequence {}; + class tag_sequenced {}; class tag_uncemented {}; class tag_arrival {}; class tag_hash {}; @@ -138,13 +137,12 @@ public: // clang-format off using ordered_roots = boost::multi_index_container>, + mi::sequenced>, mi::hashed_unique, mi::member> >>; // clang-format on ordered_roots roots; - using roots_iterator = active_transactions::ordered_roots::index_iterator::type; explicit active_transactions (nano::node &, nano::confirmation_height_processor &); ~active_transactions ();