From dcf214c9580ee9212f6dd72678056c24b08f4298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Fri, 5 Apr 2024 22:44:27 +0200 Subject: [PATCH] Fix missing channel source --- nano/node/vote_processor.cpp | 12 +++++------- nano/node/vote_processor.hpp | 5 +---- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/nano/node/vote_processor.cpp b/nano/node/vote_processor.cpp index b211974977..4405bf5838 100644 --- a/nano/node/vote_processor.cpp +++ b/nano/node/vote_processor.cpp @@ -24,8 +24,7 @@ nano::vote_processor::vote_processor (nano::active_transactions & active_a, nano rep_crawler{ rep_crawler_a }, ledger{ ledger_a }, network_params{ network_params_a }, - rep_tiers{ rep_tiers_a }, - max_votes{ flags_a.vote_processor_capacity } + rep_tiers{ rep_tiers_a } { queue.max_size_query = [this] (auto const & origin) { switch (origin.source) @@ -33,7 +32,7 @@ nano::vote_processor::vote_processor (nano::active_transactions & active_a, nano case nano::rep_tier::tier_3: case nano::rep_tier::tier_2: case nano::rep_tier::tier_1: - return 512; + return 256; case nano::rep_tier::none: return 32; } @@ -96,7 +95,7 @@ bool nano::vote_processor::vote (std::shared_ptr const & vote, std:: bool added = false; { nano::lock_guard guard{ mutex }; - added = queue.push ({ vote, channel }, tier); + added = queue.push (vote, { tier, channel }); } if (added) { @@ -147,10 +146,9 @@ void nano::vote_processor::run_batch (nano::unique_lock & lock) lock.unlock (); - for (auto const & [entry, origin] : batch) + for (auto const & [vote, origin] : batch) { - auto const & [vote, channel] = entry; - vote_blocking (vote, channel); + vote_blocking (vote, origin.channel); } total_processed += batch.size (); diff --git a/nano/node/vote_processor.hpp b/nano/node/vote_processor.hpp index 785e510c8c..6a8c454a87 100644 --- a/nano/node/vote_processor.hpp +++ b/nano/node/vote_processor.hpp @@ -75,10 +75,7 @@ class vote_processor final void run_batch (nano::unique_lock &); private: - std::size_t const max_votes; - - using entry_t = std::pair, std::shared_ptr>; - nano::fair_queue queue; + nano::fair_queue, nano::rep_tier> queue; private: bool stopped{ false };