From 19e1cc6296b9035f6a82efee0f20705eda07eb61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Mon, 20 Jan 2025 21:16:25 +0100 Subject: [PATCH] Remove unused `process_live_dispatcher` (#4831) --- nano/node/CMakeLists.txt | 2 -- nano/node/node.cpp | 4 --- nano/node/node.hpp | 3 --- nano/node/process_live_dispatcher.cpp | 30 --------------------- nano/node/process_live_dispatcher.hpp | 39 --------------------------- 5 files changed, 78 deletions(-) delete mode 100644 nano/node/process_live_dispatcher.cpp delete mode 100644 nano/node/process_live_dispatcher.hpp diff --git a/nano/node/CMakeLists.txt b/nano/node/CMakeLists.txt index 4a90531d0..d05ef817c 100644 --- a/nano/node/CMakeLists.txt +++ b/nano/node/CMakeLists.txt @@ -128,8 +128,6 @@ add_library( peer_exclusion.cpp portmapping.hpp portmapping.cpp - process_live_dispatcher.cpp - process_live_dispatcher.hpp pruning.hpp pruning.cpp recently_cemented_cache.cpp diff --git a/nano/node/node.cpp b/nano/node/node.cpp index 7030b1e56..1bb2c22de 100644 --- a/nano/node/node.cpp +++ b/nano/node/node.cpp @@ -192,8 +192,6 @@ nano::node::node (std::shared_ptr io_ctx_a, std::filesy epoch_upgrader{ *epoch_upgrader_impl }, local_block_broadcaster_impl{ std::make_unique (config.local_block_broadcaster, *this, ledger_notifications, network, confirming_set, stats, logger, !flags.disable_block_processor_republishing) }, local_block_broadcaster{ *local_block_broadcaster_impl }, - process_live_dispatcher_impl{ std::make_unique (ledger, scheduler.priority, vote_cache, websocket) }, - process_live_dispatcher{ *process_live_dispatcher_impl }, peer_history_impl{ std::make_unique (config.peer_history, store, network, logger, stats) }, peer_history{ *peer_history_impl }, monitor_impl{ std::make_unique (config.monitor, *this) }, @@ -207,8 +205,6 @@ nano::node::node (std::shared_ptr io_ctx_a, std::filesy { logger.debug (nano::log::type::node, "Constructing node..."); - process_live_dispatcher.connect (block_processor); - vote_cache.rep_weight_query = [this] (nano::account const & rep) { return ledger.weight (rep); }; diff --git a/nano/node/node.hpp b/nano/node/node.hpp index 35e753cbd..12ece5e60 100644 --- a/nano/node/node.hpp +++ b/nano/node/node.hpp @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -193,8 +192,6 @@ public: nano::epoch_upgrader & epoch_upgrader; std::unique_ptr local_block_broadcaster_impl; nano::local_block_broadcaster & local_block_broadcaster; - std::unique_ptr process_live_dispatcher_impl; - nano::process_live_dispatcher & process_live_dispatcher; std::unique_ptr peer_history_impl; nano::peer_history & peer_history; std::unique_ptr monitor_impl; diff --git a/nano/node/process_live_dispatcher.cpp b/nano/node/process_live_dispatcher.cpp deleted file mode 100644 index 2a429be8a..000000000 --- a/nano/node/process_live_dispatcher.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -nano::process_live_dispatcher::process_live_dispatcher (nano::ledger & ledger, nano::scheduler::priority & scheduler, nano::vote_cache & vote_cache, nano::websocket_server & websocket) : - ledger{ ledger }, - scheduler{ scheduler }, - vote_cache{ vote_cache }, - websocket{ websocket } -{ -} - -void nano::process_live_dispatcher::connect (nano::block_processor & block_processor) -{ -} - -void nano::process_live_dispatcher::inspect (nano::block_status const & result, nano::block const & block, secure::transaction const & transaction) -{ -} - -void nano::process_live_dispatcher::process_live (nano::block const & block, secure::transaction const & transaction) -{ -} diff --git a/nano/node/process_live_dispatcher.hpp b/nano/node/process_live_dispatcher.hpp deleted file mode 100644 index 9ba71f966..000000000 --- a/nano/node/process_live_dispatcher.hpp +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once - -namespace nano::secure -{ -class transaction; -} - -namespace nano -{ -class ledger; -class vote_cache; -class websocket_server; -class block_processor; -class process_return; -class block; - -namespace scheduler -{ - class priority; -} - -// Observes confirmed blocks and dispatches the process_live function. -class process_live_dispatcher -{ -public: - process_live_dispatcher (nano::ledger &, nano::scheduler::priority &, nano::vote_cache &, nano::websocket_server &); - void connect (nano::block_processor & block_processor); - -private: - // Block_processor observer - void inspect (nano::block_status const & result, nano::block const & block, secure::transaction const & transaction); - void process_live (nano::block const & block, secure::transaction const & transaction); - - nano::ledger & ledger; - nano::scheduler::priority & scheduler; - nano::vote_cache & vote_cache; - nano::websocket_server & websocket; -}; -}