diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2020-05-28 13:06:43 -0400 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2021-08-17 04:05:15 -0400 |
commit | 62a09a30772141ef4add2f10d29927211abf57eb (patch) | |
tree | 7158ee4508efa9696316741cafcddad9a507b7cd /src/interfaces | |
parent | fdd80b0a53b4af0b29cb6e03118e2456d053a757 (diff) |
refactor: remove ::vpwallets and related global variables
Move global wallet variables to WalletContext struct
Diffstat (limited to 'src/interfaces')
-rw-r--r-- | src/interfaces/wallet.h | 5 |
1 files changed, 4 insertions, 1 deletions
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<void(std::unique_ptr<Wallet> wallet)>; virtual std::unique_ptr<Handler> 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<Wallet> MakeWallet(const std::shared_ptr<CWallet>& wallet); +std::unique_ptr<Wallet> MakeWallet(WalletContext& context, const std::shared_ptr<CWallet>& wallet); //! Return implementation of ChainClient interface for a wallet client. This //! function will be undefined in builds where ENABLE_WALLET is false. |