Skip to content

Commit

Permalink
Debug log election confirmed details
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Oct 20, 2024
1 parent af4ef05 commit 3e69cb6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion nano/node/election.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,22 @@ void nano::election::confirm_once (nano::unique_lock<nano::mutex> & lock)

node.active.recently_confirmed.put (qualified_root, status_l.winner->hash ());

auto const extended_status = current_status_locked ();

node.stats.inc (nano::stat::type::election, nano::stat::detail::confirm_once);
node.logger.trace (nano::log::type::election, nano::log::detail::election_confirmed,
nano::log::arg{ "id", id },
nano::log::arg{ "qualified_root", qualified_root },
nano::log::arg{ "status", current_status_locked () });
nano::log::arg{ "status", extended_status });

node.logger.debug (nano::log::type::election, "Election confirmed with winner: {} (behavior: {}, state: {}, voters: {}, blocks: {}, duration: {}ms, confirmation requests: {})",
status_l.winner->hash ().to_string (),
to_string (behavior_m),
to_string (state_m),
extended_status.status.voter_count,
extended_status.status.block_count,
extended_status.status.election_duration.count (),
extended_status.status.confirmation_request_count);

node.confirming_set.add (status_l.winner->hash (), shared_from_this ());

Expand Down

0 comments on commit 3e69cb6

Please sign in to comment.