mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
refactor: Move wallet methods out of chain.h and node.h
Add WalletClient interface so node interface is cleaner and don't need wallet-specific methods. The new NodeContext::wallet_client pointer will also be needed to eliminate global wallet variables like ::vpwallets, because createWallet(), loadWallet(), getWallets(), etc methods called by the GUI need a way to get a reference to the list of open wallets if it is no longer a global variable. Also tweaks splash screen registration for load wallet events to be delayed until after wallet client is created.
This commit is contained in:
@@ -20,6 +20,7 @@ class PeerLogicValidation;
|
||||
namespace interfaces {
|
||||
class Chain;
|
||||
class ChainClient;
|
||||
class WalletClient;
|
||||
} // namespace interfaces
|
||||
|
||||
//! NodeContext struct containing references to chain state and connection
|
||||
@@ -40,7 +41,11 @@ struct NodeContext {
|
||||
std::unique_ptr<BanMan> banman;
|
||||
ArgsManager* args{nullptr}; // Currently a raw pointer because the memory is not managed by this struct
|
||||
std::unique_ptr<interfaces::Chain> chain;
|
||||
//! List of all chain clients (wallet processes or other client) connected to node.
|
||||
std::vector<std::unique_ptr<interfaces::ChainClient>> chain_clients;
|
||||
//! Reference to chain client that should used to load or create wallets
|
||||
//! opened by the gui.
|
||||
interfaces::WalletClient* wallet_client{nullptr};
|
||||
std::unique_ptr<CScheduler> scheduler;
|
||||
std::function<void()> rpc_interruption_point = [] {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user