Skip to content

Commit

Permalink
Break up long complex statement into 2 statements
Browse files Browse the repository at this point in the history
  • Loading branch information
dsiganos committed Jan 12, 2024
1 parent 55136b5 commit a185675
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions nano/node/active_transactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,12 +434,11 @@ nano::election_insertion_result nano::active_transactions::insert (std::shared_p
{
result.inserted = true;
auto hash (block_a->hash ());
result.election = nano::make_shared<nano::election> (
node, block_a, nullptr, [&node = node] (auto const & rep_a) {
auto observe_rep_cb = [&node = node] (auto const & rep_a) {
// Representative is defined as online if replying to live votes or rep_crawler queries
node.online_reps.observe (rep_a);
},
election_behavior_a);
};
result.election = nano::make_shared<nano::election> (node, block_a, nullptr, observe_rep_cb,election_behavior_a);
roots.get<tag_root> ().emplace (nano::active_transactions::conflict_info{ root, result.election });
blocks.emplace (hash, result.election);
// Keep track of election count by election type
Expand Down

0 comments on commit a185675

Please sign in to comment.