Skip to content

Commit 07a9f67

Browse files
fanquakejagdeep sidhu
authored andcommitted
Merge bitcoin#19101: refactor: remove ::vpwallets and related global variables
62a09a3 refactor: remove ::vpwallets and related global variables (Russell Yanofsky) Pull request description: Get rid of global wallet list variables by moving them to WalletContext struct - [`cs_wallets`](https://github.com/bitcoin/bitcoin/blob/e638acf6970394f8eb1957366ad2d39512f33b31/src/wallet/wallet.cpp#L56) is now [`WalletContext::wallet_mutex`](https://github.com/ryanofsky/bitcoin/blob/4be544c7ec08a81952fd3f4349151cbb8bdb60e8/src/wallet/context.h#L37) - [`vpwallets`](https://github.com/bitcoin/bitcoin/blob/e638acf6970394f8eb1957366ad2d39512f33b31/src/wallet/wallet.cpp#L57) is now [`WalletContext::wallets`](https://github.com/ryanofsky/bitcoin/blob/4be544c7ec08a81952fd3f4349151cbb8bdb60e8/src/wallet/context.h#L38) - [`g_load_wallet_fns`](https://github.com/bitcoin/bitcoin/blob/e638acf6970394f8eb1957366ad2d39512f33b31/src/wallet/wallet.cpp#L58) is now [`WalletContext::wallet_load_fns`](https://github.com/ryanofsky/bitcoin/blob/4be544c7ec08a81952fd3f4349151cbb8bdb60e8/src/wallet/context.h#L39) ACKs for top commit: achow101: ACK 62a09a3 meshcollider: re-utACK 62a09a3 Tree-SHA512: 74428180d57b4214c3d96963e6ff43e8778f6f23b6880262d1272f2de67d02714fdc3ebb558f62e48655b221a642c36f80ef37c8f89d362e2d66fd93cbf03b8f
1 parent d615fa7 commit 07a9f67

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/wallet/context.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212
#include <memory>
1313
#include <vector>
1414

15+
#include <sync.h>
16+
17+
#include <functional>
18+
#include <list>
19+
#include <memory>
20+
#include <vector>
21+
1522
class ArgsManager;
1623
class CWallet;
1724
namespace interfaces {
@@ -22,6 +29,8 @@ class Wallet;
2229
struct NodeContext;
2330
using LoadWalletFn = std::function<void(std::unique_ptr<interfaces::Wallet> wallet)>;
2431

32+
using LoadWalletFn = std::function<void(std::unique_ptr<interfaces::Wallet> wallet)>;
33+
2534
//! WalletContext struct containing references to state shared between CWallet
2635
//! instances, like the reference to the chain interface, and the list of opened
2736
//! wallets.

src/wallet/wallet.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ class CAuxFeeDetails;
4848

4949
struct WalletContext;
5050

51+
struct WalletContext;
52+
5153
using LoadWalletFn = std::function<void(std::unique_ptr<interfaces::Wallet> wallet)>;
5254

5355
struct bilingual_str;

0 commit comments

Comments
 (0)