From 48f4b0c7cde11321ef67621981194d0611bdf8eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Fri, 24 May 2024 15:47:46 +0200 Subject: [PATCH] Fixes --- nano/lib/stats_enums.hpp | 1 + nano/node/confirming_set.cpp | 8 ++++---- nano/slow_test/node.cpp | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/nano/lib/stats_enums.hpp b/nano/lib/stats_enums.hpp index 4fdc489992..6bec768d2e 100644 --- a/nano/lib/stats_enums.hpp +++ b/nano/lib/stats_enums.hpp @@ -455,6 +455,7 @@ enum class detail // confirming_set notify_cemented, notify_already_cemented, + already_cemented, // election_state passive, diff --git a/nano/node/confirming_set.cpp b/nano/node/confirming_set.cpp index 2c6d7e2b32..765b0739c9 100644 --- a/nano/node/confirming_set.cpp +++ b/nano/node/confirming_set.cpp @@ -1,5 +1,3 @@ -#include "node.hpp" - #include #include #include @@ -53,6 +51,8 @@ void nano::confirming_set::add (nano::block_hash const & hash) void nano::confirming_set::start () { + debug_assert (!thread.joinable ()); + thread = std::thread{ [this] () { nano::thread_role::set (nano::thread_role::name::confirmation_height_processing); run (); @@ -146,7 +146,7 @@ void nano::confirming_set::run_batch (std::unique_lock & lock) else { already.push_back (item); - stats.inc (nano::stat::type::confirming_set, nano::stat::detail::already_confirmed); + stats.inc (nano::stat::type::confirming_set, nano::stat::detail::already_cemented); } lock.lock (); @@ -167,7 +167,7 @@ void nano::confirming_set::run_batch (std::unique_lock & lock) lock.lock (); - processing.clear (); + processing = {}; // Avoid permamently holding memory if the set was large } std::unique_ptr nano::confirming_set::collect_container_info (std::string const & name) const diff --git a/nano/slow_test/node.cpp b/nano/slow_test/node.cpp index 4d6f906936..960a205a64 100644 --- a/nano/slow_test/node.cpp +++ b/nano/slow_test/node.cpp @@ -1145,7 +1145,7 @@ TEST (confirmation_height, many_accounts_send_receive_self_no_elections) nano::block_hash block_hash_being_processed{ 0 }; nano::store::write_queue write_queue{ false }; - nano::confirming_set confirming_set{ ledger }; + nano::confirming_set confirming_set{ ledger, stats }; auto const num_accounts = 100000;