Bitcoin Core  22.99.0
P2P Digital Currency
Public Member Functions | Public Attributes | List of all members
WalletContext Struct Reference

WalletContext struct containing references to state shared between CWallet instances, like the reference to the chain interface, and the list of opened wallets. More...

#include <context.h>

Collaboration diagram for WalletContext:
[legend]

Public Member Functions

std::vector< std::shared_ptr< CWallet > > wallets GUARDED_BY (wallets_mutex)
 
std::list< LoadWalletFn > wallet_load_fns GUARDED_BY (wallets_mutex)
 
 WalletContext ()
 Declare default constructor and destructor that are not inline, so code instantiating the WalletContext struct doesn't need to #include class definitions for smart pointer and container members. More...
 
 ~WalletContext ()
 

Public Attributes

interfaces::Chainchain {nullptr}
 
ArgsManagerargs {nullptr}
 
Mutex wallets_mutex
 

Detailed Description

WalletContext struct containing references to state shared between CWallet instances, like the reference to the chain interface, and the list of opened wallets.

Future shared state can be added here as an alternative to adding global variables.

The struct isn't intended to have any member functions. It should just be a collection of state pointers that doesn't pull in dependencies or implement behavior.

Definition at line 34 of file context.h.

Constructor & Destructor Documentation

◆ WalletContext()

WalletContext::WalletContext ( )

Declare default constructor and destructor that are not inline, so code instantiating the WalletContext struct doesn't need to #include class definitions for smart pointer and container members.

Definition at line 7 of file context.cpp.

◆ ~WalletContext()

WalletContext::~WalletContext ( )

Definition at line 8 of file context.cpp.

Member Function Documentation

◆ GUARDED_BY() [1/2]

std::vector<std::shared_ptr<CWallet> > wallets WalletContext::GUARDED_BY ( wallets_mutex  )

◆ GUARDED_BY() [2/2]

std::list<LoadWalletFn> wallet_load_fns WalletContext::GUARDED_BY ( wallets_mutex  )

Member Data Documentation

◆ args

ArgsManager* WalletContext::args {nullptr}

Definition at line 36 of file context.h.

◆ chain

interfaces::Chain* WalletContext::chain {nullptr}

Definition at line 35 of file context.h.

◆ wallets_mutex

Mutex WalletContext::wallets_mutex

Definition at line 39 of file context.h.


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