From 0b28518f24eff5e6ec19cd9fce3c485d19af5eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Wed, 24 Jul 2024 14:34:24 +0200 Subject: [PATCH] Use unique ptr --- nano/node/message_processor.cpp | 1 + nano/node/node.cpp | 4 +++- nano/node/node.hpp | 8 ++++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/nano/node/message_processor.cpp b/nano/node/message_processor.cpp index a479b7bf7b..dc1684789a 100644 --- a/nano/node/message_processor.cpp +++ b/nano/node/message_processor.cpp @@ -1,4 +1,5 @@ #include +#include #include #include diff --git a/nano/node/node.cpp b/nano/node/node.cpp index eaa141884d..f296ae5cca 100644 --- a/nano/node/node.cpp +++ b/nano/node/node.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -216,7 +217,8 @@ nano::node::node (std::shared_ptr io_ctx_a, std::filesy aggregator{ *aggregator_impl }, wallets (wallets_store.init_error (), *this), backlog{ nano::backlog_population_config (config), scheduler, ledger, stats }, - ascendboot{ config, block_processor, ledger, network, stats }, + ascendboot_impl{ std::make_unique (config, block_processor, ledger, network, stats) }, + ascendboot{ *ascendboot_impl }, websocket{ config.websocket_config, observers, wallets, ledger, io_ctx, logger }, epoch_upgrader{ *this, ledger, store, network_params, logger }, local_block_broadcaster_impl{ std::make_unique (config.local_block_broadcaster, *this, block_processor, network, confirming_set, stats, logger, !flags.disable_block_processor_republishing) }, diff --git a/nano/node/node.hpp b/nano/node/node.hpp index 6b8d2eec94..020910bf1f 100644 --- a/nano/node/node.hpp +++ b/nano/node/node.hpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -62,6 +61,10 @@ namespace transport { class tcp_listener; } +namespace bootstrap_ascending +{ + class service; +} namespace rocksdb { } // Declare a namespace rocksdb inside nano so all references to the rocksdb library need to be globally scoped e.g. ::rocksdb::Slice @@ -209,7 +212,8 @@ class node final : public std::enable_shared_from_this nano::request_aggregator & aggregator; nano::wallets wallets; nano::backlog_population backlog; - nano::bootstrap_ascending::service ascendboot; + std::unique_ptr ascendboot_impl; + nano::bootstrap_ascending::service & ascendboot; nano::websocket_server websocket; nano::epoch_upgrader epoch_upgrader; std::unique_ptr local_block_broadcaster_impl;