Use unique ptr for backlog_population

This commit is contained in:
Piotr Wójcik 2024-09-09 22:25:51 +02:00
commit f45835c610
2 changed files with 6 additions and 3 deletions

View file

@ -4,6 +4,7 @@
#include <nano/lib/tomlconfig.hpp>
#include <nano/lib/utility.hpp>
#include <nano/node/active_elections.hpp>
#include <nano/node/backlog_population.hpp>
#include <nano/node/bootstrap_ascending/service.hpp>
#include <nano/node/common.hpp>
#include <nano/node/confirming_set.hpp>
@ -195,7 +196,8 @@ nano::node::node (std::shared_ptr<boost::asio::io_context> io_ctx_a, std::filesy
aggregator_impl{ std::make_unique<nano::request_aggregator> (config.request_aggregator, *this, stats, generator, final_generator, history, ledger, wallets, vote_router) },
aggregator{ *aggregator_impl },
wallets (wallets_store.init_error (), *this),
backlog{ config.backlog_population, scheduler, ledger, stats },
backlog_impl{ std::make_unique<nano::backlog_population> (config.backlog_population, scheduler, ledger, stats) },
backlog{ *backlog_impl },
ascendboot_impl{ std::make_unique<nano::bootstrap_ascending::service> (config, block_processor, ledger, network, stats, logger) },
ascendboot{ *ascendboot_impl },
websocket{ config.websocket_config, observers, wallets, ledger, io_ctx, logger },

View file

@ -6,7 +6,6 @@
#include <nano/lib/stats.hpp>
#include <nano/lib/thread_pool.hpp>
#include <nano/lib/work.hpp>
#include <nano/node/backlog_population.hpp>
#include <nano/node/bandwidth_limiter.hpp>
#include <nano/node/blockprocessor.hpp>
#include <nano/node/bootstrap/bootstrap.hpp>
@ -41,6 +40,7 @@
namespace nano
{
class active_elections;
class backlog_population;
class confirming_set;
class message_processor;
class monitor;
@ -208,7 +208,8 @@ public:
std::unique_ptr<nano::request_aggregator> aggregator_impl;
nano::request_aggregator & aggregator;
nano::wallets wallets;
nano::backlog_population backlog;
std::unique_ptr<nano::backlog_population> backlog_impl;
nano::backlog_population & backlog;
std::unique_ptr<nano::bootstrap_ascending::service> ascendboot_impl;
nano::bootstrap_ascending::service & ascendboot;
nano::websocket_server websocket;