diff --git a/nano/node/scheduler/priority.cpp b/nano/node/scheduler/priority.cpp index 1bb0e2e276..6cc21d8ec4 100644 --- a/nano/node/scheduler/priority.cpp +++ b/nano/node/scheduler/priority.cpp @@ -1,5 +1,6 @@ #include #include +#include #include nano::scheduler::priority::priority (nano::node & node_a, nano::stats & stats_a) : @@ -106,11 +107,12 @@ void nano::scheduler::priority::run () if (predicate ()) { - auto block = buckets->top (); + auto [block, limiter] = buckets->top (); + debug_assert (limiter->available ()); buckets->pop (); lock.unlock (); stats.inc (nano::stat::type::election_scheduler, nano::stat::detail::insert_priority); - auto result = node.active.insert (block.first); + auto result = limiter->activate (block); if (result.inserted) { stats.inc (nano::stat::type::election_scheduler, nano::stat::detail::insert_priority_success);