Bitcoin Core 28.99.0
P2P Digital Currency
Public Member Functions | Public Attributes | List of all members
node::NodeContext Struct Reference

NodeContext struct containing references to chain state and connection state. More...

#include <context.h>

Collaboration diagram for node::NodeContext:
[legend]

Public Member Functions

 NodeContext ()
 Declare default constructor and destructor that are not inline, so code instantiating the NodeContext struct doesn't need to #include class definitions for all the unique_ptr members. More...
 
 ~NodeContext ()
 

Public Attributes

std::unique_ptr< kernel::Contextkernel
 libbitcoin_kernel context More...
 
std::unique_ptr< ECC_Contextecc_context
 
interfaces::Initinit {nullptr}
 Init interface for initializing current process and connecting to other processes. More...
 
std::function< bool()> shutdown_request
 Function to request a shutdown. More...
 
util::SignalInterruptshutdown_signal {nullptr}
 Interrupt object used to track whether node shutdown was requested. More...
 
std::unique_ptr< AddrManaddrman
 
std::unique_ptr< CConnmanconnman
 
std::unique_ptr< CTxMemPoolmempool
 
std::unique_ptr< const NetGroupManagernetgroupman
 
std::unique_ptr< CBlockPolicyEstimatorfee_estimator
 
std::unique_ptr< PeerManagerpeerman
 
std::unique_ptr< ChainstateManagerchainman
 
std::unique_ptr< BanManbanman
 
ArgsManagerargs {nullptr}
 
std::vector< BaseIndex * > indexes
 
std::unique_ptr< interfaces::Chainchain
 
std::vector< std::unique_ptr< interfaces::ChainClient > > chain_clients
 List of all chain clients (wallet processes or other client) connected to node. More...
 
std::unique_ptr< interfaces::Miningmining
 Reference to chain client that should used to load or create wallets opened by the gui. More...
 
interfaces::WalletLoaderwallet_loader {nullptr}
 
std::unique_ptr< CSchedulerscheduler
 
std::function< void()> rpc_interruption_point = [] {}
 
std::unique_ptr< KernelNotificationsnotifications
 Issues blocking calls about sync status, errors and warnings. More...
 
std::unique_ptr< ValidationSignalsvalidation_signals
 Issues calls about blocks and transactions. More...
 
std::atomic< int > exit_status {EXIT_SUCCESS}
 
std::unique_ptr< node::Warningswarnings
 Manages all the node warnings. More...
 
std::thread background_init_thread
 

Detailed Description

NodeContext struct containing references to chain state and connection state.

This is used by init, rpc, and test code to pass object references around without needing to declare the same variables and parameters repeatedly, or to use globals. More variables could be added to this struct (particularly references to validation objects) to eliminate use of globals and make code more modular and testable. The struct isn't intended to have any member functions. It should just be a collection of references that can be used without pulling in unwanted dependencies or functionality.

Definition at line 56 of file context.h.

Constructor & Destructor Documentation

◆ NodeContext()

node::NodeContext::NodeContext ( )
default

Declare default constructor and destructor that are not inline, so code instantiating the NodeContext struct doesn't need to #include class definitions for all the unique_ptr members.

◆ ~NodeContext()

node::NodeContext::~NodeContext ( )
default

Member Data Documentation

◆ addrman

std::unique_ptr<AddrMan> node::NodeContext::addrman

Definition at line 66 of file context.h.

◆ args

ArgsManager* node::NodeContext::args {nullptr}

Definition at line 74 of file context.h.

◆ background_init_thread

std::thread node::NodeContext::background_init_thread

Definition at line 92 of file context.h.

◆ banman

std::unique_ptr<BanMan> node::NodeContext::banman

Definition at line 73 of file context.h.

◆ chain

std::unique_ptr<interfaces::Chain> node::NodeContext::chain

Definition at line 76 of file context.h.

◆ chain_clients

std::vector<std::unique_ptr<interfaces::ChainClient> > node::NodeContext::chain_clients

List of all chain clients (wallet processes or other client) connected to node.

Definition at line 78 of file context.h.

◆ chainman

std::unique_ptr<ChainstateManager> node::NodeContext::chainman

Definition at line 72 of file context.h.

◆ connman

std::unique_ptr<CConnman> node::NodeContext::connman

Definition at line 67 of file context.h.

◆ ecc_context

std::unique_ptr<ECC_Context> node::NodeContext::ecc_context

Definition at line 59 of file context.h.

◆ exit_status

std::atomic<int> node::NodeContext::exit_status {EXIT_SUCCESS}

Definition at line 89 of file context.h.

◆ fee_estimator

std::unique_ptr<CBlockPolicyEstimator> node::NodeContext::fee_estimator

Definition at line 70 of file context.h.

◆ indexes

std::vector<BaseIndex*> node::NodeContext::indexes

Definition at line 75 of file context.h.

◆ init

interfaces::Init* node::NodeContext::init {nullptr}

Init interface for initializing current process and connecting to other processes.

Definition at line 61 of file context.h.

◆ kernel

std::unique_ptr<kernel::Context> node::NodeContext::kernel

libbitcoin_kernel context

Definition at line 58 of file context.h.

◆ mempool

std::unique_ptr<CTxMemPool> node::NodeContext::mempool

Definition at line 68 of file context.h.

◆ mining

std::unique_ptr<interfaces::Mining> node::NodeContext::mining

Reference to chain client that should used to load or create wallets opened by the gui.

Definition at line 81 of file context.h.

◆ netgroupman

std::unique_ptr<const NetGroupManager> node::NodeContext::netgroupman

Definition at line 69 of file context.h.

◆ notifications

std::unique_ptr<KernelNotifications> node::NodeContext::notifications

Issues blocking calls about sync status, errors and warnings.

Definition at line 86 of file context.h.

◆ peerman

std::unique_ptr<PeerManager> node::NodeContext::peerman

Definition at line 71 of file context.h.

◆ rpc_interruption_point

std::function<void()> node::NodeContext::rpc_interruption_point = [] {}

Definition at line 84 of file context.h.

◆ scheduler

std::unique_ptr<CScheduler> node::NodeContext::scheduler

Definition at line 83 of file context.h.

◆ shutdown_request

std::function<bool()> node::NodeContext::shutdown_request

Function to request a shutdown.

Definition at line 63 of file context.h.

◆ shutdown_signal

util::SignalInterrupt* node::NodeContext::shutdown_signal {nullptr}

Interrupt object used to track whether node shutdown was requested.

Definition at line 65 of file context.h.

◆ validation_signals

std::unique_ptr<ValidationSignals> node::NodeContext::validation_signals

Issues calls about blocks and transactions.

Definition at line 88 of file context.h.

◆ wallet_loader

interfaces::WalletLoader* node::NodeContext::wallet_loader {nullptr}

Definition at line 82 of file context.h.

◆ warnings

std::unique_ptr<node::Warnings> node::NodeContext::warnings

Manages all the node warnings.

Definition at line 91 of file context.h.


The documentation for this struct was generated from the following files: