Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/context.h
// Copyright (c) 2020 The Bitcoin Core developers | // Copyright (c) 2020 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_WALLET_CONTEXT_H | #ifndef BITCOIN_WALLET_CONTEXT_H | ||||
#define BITCOIN_WALLET_CONTEXT_H | #define BITCOIN_WALLET_CONTEXT_H | ||||
class ArgsManager; | |||||
namespace interfaces { | namespace interfaces { | ||||
class Chain; | class Chain; | ||||
} // namespace interfaces | } // namespace interfaces | ||||
//! WalletContext struct containing references to state shared between CWallet | //! WalletContext struct containing references to state shared between CWallet | ||||
//! instances, like the reference to the chain interface, and the list of opened | //! instances, like the reference to the chain interface, and the list of opened | ||||
//! wallets. | //! wallets. | ||||
//! | //! | ||||
//! Future shared state can be added here as an alternative to adding global | //! Future shared state can be added here as an alternative to adding global | ||||
//! variables. | //! variables. | ||||
//! | //! | ||||
//! The struct isn't intended to have any member functions. It should just be a | //! 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 | //! collection of state pointers that doesn't pull in dependencies or implement | ||||
//! behavior. | //! behavior. | ||||
struct WalletContext { | struct WalletContext { | ||||
interfaces::Chain *chain{nullptr}; | interfaces::Chain *chain{nullptr}; | ||||
ArgsManager *args{nullptr}; | |||||
//! Declare default constructor and destructor that are not inline, so code | //! Declare default constructor and destructor that are not inline, so code | ||||
//! instantiating the WalletContext struct doesn't need to #include class | //! instantiating the WalletContext struct doesn't need to #include class | ||||
//! definitions for smart pointer and container members. | //! definitions for smart pointer and container members. | ||||
WalletContext(); | WalletContext(); | ||||
~WalletContext(); | ~WalletContext(); | ||||
}; | }; | ||||
#endif // BITCOIN_WALLET_CONTEXT_H | #endif // BITCOIN_WALLET_CONTEXT_H |