WalletContext struct containing references to state shared between CWallet instances, like the reference to the chain interface, and the list of opened wallets.
Declared in <wallet/context.h>
struct WalletContext;
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.
| Name | Description |
|---|---|
WalletContext [constructor] | 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. |
~WalletContext [destructor] | Destroys the wallet context. |
| Name | Description |
|---|---|
args | Command-line and configuration arguments. |
chain | Interface to the blockchain, shared by all wallets. |
scheduler | Scheduler used to run periodic wallet tasks. |
wallet_load_fns | Callbacks invoked when a wallet is loaded. |
wallets | The currently opened wallets. |
wallets_mutex | Guards the list of opened wallets and load callbacks. |
| Name | Description |
|---|---|
AddWallet | Register a loaded wallet with the wallet context. |
CreateWallet | Create a new wallet and load it into the context. |
EnsureWalletContext | Retrieves the WalletContext stored in an RPC context, throwing if absent. |
GetDefaultWallet | Return the default wallet and report how many wallets are loaded. |
GetWallet | Look up a loaded wallet by name. |
GetWallets | Return all wallets currently loaded in the context. |
HandleLoadWallet | Register a callback invoked whenever a wallet is loaded. |
LoadWallet | Load an existing wallet from disk into the context. |
LoadWallets | Load wallet databases. |
MaybeResendWalletTxs | Called periodically by the schedule thread. Prompts individual wallets to resend their transactions. Actual rebroadcast schedule is managed by the wallets themselves. |
NotifyWalletLoaded | Fire the load-wallet callbacks for a newly loaded wallet. |
RemoveWallet | Remove a wallet from the wallet context and optionally update its load-on-startup setting. |
RemoveWallet | Remove a wallet from the wallet context and optionally update its load-on-startup setting. |
RestoreWallet | Restore a wallet from a backup file. |
StartWallets | Complete startup of wallets. |
UnloadWallets | Stop and unload all wallets held by the context. |
VerifyWallets | Responsible for reading and validating the -wallet arguments and verifying the wallet database. |