Skip to content

Commit

Permalink
Use unique ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Jul 24, 2024
1 parent 5aff36e commit 0b28518
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions nano/node/message_processor.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <nano/lib/thread_roles.hpp>
#include <nano/node/bootstrap_ascending/service.hpp>
#include <nano/node/message_processor.hpp>
#include <nano/node/node.hpp>

Expand Down
4 changes: 3 additions & 1 deletion nano/node/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <nano/lib/tomlconfig.hpp>
#include <nano/lib/utility.hpp>
#include <nano/node/active_elections.hpp>
#include <nano/node/bootstrap_ascending/service.hpp>
#include <nano/node/common.hpp>
#include <nano/node/confirming_set.hpp>
#include <nano/node/daemonconfig.hpp>
Expand Down Expand Up @@ -216,7 +217,8 @@ nano::node::node (std::shared_ptr<boost::asio::io_context> 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<nano::bootstrap_ascending::service> (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<nano::local_block_broadcaster> (config.local_block_broadcaster, *this, block_processor, network, confirming_set, stats, logger, !flags.disable_block_processor_republishing) },
Expand Down
8 changes: 6 additions & 2 deletions nano/node/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <nano/node/bootstrap/bootstrap.hpp>
#include <nano/node/bootstrap/bootstrap_attempt.hpp>
#include <nano/node/bootstrap/bootstrap_server.hpp>
#include <nano/node/bootstrap_ascending/service.hpp>
#include <nano/node/distributed_work_factory.hpp>
#include <nano/node/epoch_upgrader.hpp>
#include <nano/node/fwd.hpp>
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -209,7 +212,8 @@ class node final : public std::enable_shared_from_this<node>
nano::request_aggregator & aggregator;
nano::wallets wallets;
nano::backlog_population backlog;
nano::bootstrap_ascending::service ascendboot;
std::unique_ptr<nano::bootstrap_ascending::service> ascendboot_impl;
nano::bootstrap_ascending::service & ascendboot;
nano::websocket_server websocket;
nano::epoch_upgrader epoch_upgrader;
std::unique_ptr<nano::local_block_broadcaster> local_block_broadcaster_impl;
Expand Down

0 comments on commit 0b28518

Please sign in to comment.