From 62a09a30772141ef4add2f10d29927211abf57eb Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Thu, 28 May 2020 13:06:43 -0400 Subject: refactor: remove ::vpwallets and related global variables Move global wallet variables to WalletContext struct --- src/interfaces/wallet.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/interfaces') diff --git a/src/interfaces/wallet.h b/src/interfaces/wallet.h index fb1febc11b..a85db04b8b 100644 --- a/src/interfaces/wallet.h +++ b/src/interfaces/wallet.h @@ -332,6 +332,9 @@ public: //! loaded at startup or by RPC. using LoadWalletFn = std::function wallet)>; virtual std::unique_ptr handleLoadWallet(LoadWalletFn fn) = 0; + + //! Return pointer to internal context, useful for testing. + virtual WalletContext* context() { return nullptr; } }; //! Information about one wallet address. @@ -410,7 +413,7 @@ struct WalletTxOut //! Return implementation of Wallet interface. This function is defined in //! dummywallet.cpp and throws if the wallet component is not compiled. -std::unique_ptr MakeWallet(const std::shared_ptr& wallet); +std::unique_ptr MakeWallet(WalletContext& context, const std::shared_ptr& wallet); //! Return implementation of ChainClient interface for a wallet client. This //! function will be undefined in builds where ENABLE_WALLET is false. -- cgit v1.2.3