mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-25 15:05:55 +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:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <init.h>
|
||||
#include <interfaces/chain.h>
|
||||
#include <interfaces/wallet.h>
|
||||
#include <net.h>
|
||||
#include <node/context.h>
|
||||
#include <node/ui_interface.h>
|
||||
@@ -129,5 +130,7 @@ void WalletInit::Construct(NodeContext& node) const
|
||||
settings.rw_settings["wallet"] = wallets;
|
||||
});
|
||||
}
|
||||
node.chain_clients.emplace_back(interfaces::MakeWalletClient(*node.chain, args, args.GetArgs("-wallet")));
|
||||
auto wallet_client = interfaces::MakeWalletClient(*node.chain, args, args.GetArgs("-wallet"));
|
||||
node.wallet_client = wallet_client.get();
|
||||
node.chain_clients.emplace_back(std::move(wallet_client));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user