Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed May 24, 2024
1 parent 48fb94b commit 4204f98
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions nano/lib/stats_enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ enum class detail
// confirming_set
notify_cemented,
notify_already_cemented,
already_cemented,

// election_state
passive,
Expand Down
8 changes: 4 additions & 4 deletions nano/node/confirming_set.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include "node.hpp"

#include <nano/lib/thread_roles.hpp>
#include <nano/node/confirming_set.hpp>
#include <nano/secure/ledger.hpp>
Expand Down Expand Up @@ -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 ();
Expand Down Expand Up @@ -146,7 +146,7 @@ void nano::confirming_set::run_batch (std::unique_lock<std::mutex> & 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 ();
Expand All @@ -167,7 +167,7 @@ void nano::confirming_set::run_batch (std::unique_lock<std::mutex> & lock)

lock.lock ();

processing.clear ();
processing = {}; // Avoid permamently holding memory if the set was large
}

std::unique_ptr<nano::container_info_component> nano::confirming_set::collect_container_info (std::string const & name) const
Expand Down
2 changes: 1 addition & 1 deletion nano/slow_test/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 4204f98

Please sign in to comment.