mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-14 01:18:55 +00:00
Replace with RPC request reference to new WalletContext struct similar to the existing NodeContext struct and reference. This PR is a followup to 25ad2c623af30056ffb36dcd203a52edda2b170f https://github.com/bitcoin/bitcoin/pull/18740 removing the g_rpc_node global. Some later PRs will follow this up and move more wallet globals to the WalletContext struct. Co-authored-by: João Barbosa <joao.paulo.barbosa@gmail.com>
33 lines
1.1 KiB
C++
33 lines
1.1 KiB
C++
// Copyright (c) 2020 The Bitcoin Core developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#ifndef BITCOIN_WALLET_CONTEXT_H
|
|
#define BITCOIN_WALLET_CONTEXT_H
|
|
|
|
namespace interfaces {
|
|
class Chain;
|
|
} // namespace interfaces
|
|
|
|
//! 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.
|
|
struct WalletContext {
|
|
interfaces::Chain* chain{nullptr};
|
|
|
|
//! 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();
|
|
~WalletContext();
|
|
};
|
|
|
|
#endif // BITCOIN_WALLET_CONTEXT_H
|