Skip to content

Commit

Permalink
Store as unique ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Apr 7, 2024
1 parent 5fa9e49 commit 378e69b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion nano/node/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <nano/node/telemetry.hpp>
#include <nano/node/transport/tcp_listener.hpp>
#include <nano/node/vote_generator.hpp>
#include <nano/node/vote_processor.hpp>
#include <nano/node/websocket.hpp>
#include <nano/secure/ledger.hpp>
#include <nano/store/component.hpp>
Expand Down Expand Up @@ -178,7 +179,8 @@ nano::node::node (std::shared_ptr<boost::asio::io_context> io_ctx_a, std::filesy
active{ *active_impl },
rep_crawler (config.rep_crawler, *this),
rep_tiers{ ledger, network_params, online_reps, stats, logger },
vote_processor{ config.vote_processor, active, observers, stats, flags, logger, online_reps, rep_crawler, ledger, network_params, rep_tiers },
vote_processor_impl{ std::make_unique<nano::vote_processor> (config.vote_processor, active, observers, stats, flags, logger, online_reps, rep_crawler, ledger, network_params, rep_tiers) },
vote_processor{ *vote_processor_impl },
warmed_up (0),
online_reps (ledger, config),
history_impl{ std::make_unique<nano::local_vote_history> (config.network_params.voting) },
Expand Down
5 changes: 3 additions & 2 deletions nano/node/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <nano/node/transport/tcp_server.hpp>
#include <nano/node/unchecked_map.hpp>
#include <nano/node/vote_cache.hpp>
#include <nano/node/vote_processor.hpp>
#include <nano/node/wallet.hpp>
#include <nano/node/websocket.hpp>
#include <nano/node/write_database_queue.hpp>
Expand All @@ -48,6 +47,7 @@ namespace nano
class active_transactions;
class confirming_set;
class node;
class vote_processor;
class work_pool;

namespace scheduler
Expand Down Expand Up @@ -175,7 +175,8 @@ class node final : public std::enable_shared_from_this<node>
nano::online_reps online_reps;
nano::rep_crawler rep_crawler;
nano::rep_tiers rep_tiers;
nano::vote_processor vote_processor;
std::unique_ptr<nano::vote_processor> vote_processor_impl;
nano::vote_processor & vote_processor;
unsigned warmed_up;
std::unique_ptr<nano::local_vote_history> history_impl;
nano::local_vote_history & history;
Expand Down

0 comments on commit 378e69b

Please sign in to comment.