Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
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.
 
 ~NodeContext ()
 

Public Attributes

std::unique_ptr< AddrManaddrman
 
std::unique_ptr< CConnmanconnman
 
std::unique_ptr< CTxMemPoolmempool
 
std::unique_ptr< PeerManagerpeerman
 
std::unique_ptr< ChainstateManagerchainman
 
std::unique_ptr< BanManbanman
 
ArgsManagerargs {nullptr}
 
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.
 
interfaces::WalletClientwallet_client {nullptr}
 Reference to chain client that should used to load or create wallets opened by the gui.
 
std::unique_ptr< CSchedulerscheduler
 
std::function< void()> rpc_interruption_point = [] {}
 
std::unique_ptr< KernelNotificationsnotifications
 
std::unique_ptr< avalanche::Processoravalanche
 

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 43 of file context.h.

Constructor & Destructor Documentation

◆ NodeContext()

node::NodeContext::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.

Definition at line 19 of file context.cpp.

◆ ~NodeContext()

node::NodeContext::~NodeContext ( )

Definition at line 20 of file context.cpp.

Member Data Documentation

◆ addrman

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

Definition at line 44 of file context.h.

◆ args

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

Definition at line 51 of file context.h.

◆ avalanche

std::unique_ptr<avalanche::Processor> node::NodeContext::avalanche

Definition at line 63 of file context.h.

◆ banman

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

Definition at line 49 of file context.h.

◆ chain

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

Definition at line 52 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 55 of file context.h.

◆ chainman

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

Definition at line 48 of file context.h.

◆ connman

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

Definition at line 45 of file context.h.

◆ mempool

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

Definition at line 46 of file context.h.

◆ notifications

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

Definition at line 61 of file context.h.

◆ peerman

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

Definition at line 47 of file context.h.

◆ rpc_interruption_point

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

Definition at line 60 of file context.h.

◆ scheduler

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

Definition at line 59 of file context.h.

◆ wallet_client

interfaces::WalletClient* node::NodeContext::wallet_client {nullptr}

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

Definition at line 58 of file context.h.


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