Remove election scheduler confirmation_action as it's unused. (#4125)

This commit is contained in:
clemahieu 2023-02-14 13:29:52 +00:00 committed by GitHub
commit 14e4d7ebf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -32,10 +32,10 @@ void nano::election_scheduler::stop ()
nano::join_or_pass (thread); nano::join_or_pass (thread);
} }
void nano::election_scheduler::manual (std::shared_ptr<nano::block> const & block_a, boost::optional<nano::uint128_t> const & previous_balance_a, nano::election_behavior election_behavior_a, std::function<void (std::shared_ptr<nano::block> const &)> const & confirmation_action_a) void nano::election_scheduler::manual (std::shared_ptr<nano::block> const & block_a, boost::optional<nano::uint128_t> const & previous_balance_a, nano::election_behavior election_behavior_a)
{ {
nano::lock_guard<nano::mutex> lock{ mutex }; nano::lock_guard<nano::mutex> lock{ mutex };
manual_queue.push_back (std::make_tuple (block_a, previous_balance_a, election_behavior_a, confirmation_action_a)); manual_queue.push_back (std::make_tuple (block_a, previous_balance_a, election_behavior_a));
notify (); notify ();
} }
@ -140,11 +140,11 @@ void nano::election_scheduler::run ()
} }
else if (manual_queue_predicate ()) else if (manual_queue_predicate ())
{ {
auto const [block, previous_balance, election_behavior, confirmation_action] = manual_queue.front (); auto const [block, previous_balance, election_behavior] = manual_queue.front ();
manual_queue.pop_front (); manual_queue.pop_front ();
lock.unlock (); lock.unlock ();
nano::unique_lock<nano::mutex> lock2 (node.active.mutex); nano::unique_lock<nano::mutex> lock2 (node.active.mutex);
node.active.insert_impl (lock2, block, election_behavior, confirmation_action); node.active.insert_impl (lock2, block, election_behavior);
} }
else if (priority_queue_predicate ()) else if (priority_queue_predicate ())
{ {

View file

@ -27,7 +27,7 @@ public:
// Manualy start an election for a block // Manualy start an election for a block
// Call action with confirmed block, may be different than what we started with // Call action with confirmed block, may be different than what we started with
void manual (std::shared_ptr<nano::block> const &, boost::optional<nano::uint128_t> const & = boost::none, nano::election_behavior = nano::election_behavior::normal, std::function<void (std::shared_ptr<nano::block> const &)> const & = nullptr); void manual (std::shared_ptr<nano::block> const &, boost::optional<nano::uint128_t> const & = boost::none, nano::election_behavior = nano::election_behavior::normal);
/** /**
* Activates the first unconfirmed block of \p account_a * Activates the first unconfirmed block of \p account_a
* @return true if account was activated * @return true if account was activated
@ -52,8 +52,8 @@ private:
bool overfill_predicate () const; bool overfill_predicate () const;
nano::prioritization priority; nano::prioritization priority;
std::deque<std::tuple<std::shared_ptr<nano::block>, boost::optional<nano::uint128_t>, nano::election_behavior, std::function<void (std::shared_ptr<nano::block>)>>> manual_queue;
std::deque<std::tuple<std::shared_ptr<nano::block>, boost::optional<nano::uint128_t>, nano::election_behavior>> manual_queue;
bool stopped{ false }; bool stopped{ false };
nano::condition_variable condition; nano::condition_variable condition;
mutable nano::mutex mutex; mutable nano::mutex mutex;