Skip to content

Commit 63dc779

Browse files
committed
merge bitcoin#22868: Call load handlers without cs_wallet locked
continuation of 87d775d from dash#6192
1 parent 698e01e commit 63dc779

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/wallet/context.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ using LoadWalletFn = std::function<void(std::unique_ptr<interfaces::Wallet> wall
3838
struct WalletContext {
3939
interfaces::Chain* chain{nullptr};
4040
ArgsManager* args{nullptr}; // Currently a raw pointer because the memory is not managed by this struct
41+
// It is unsafe to lock this after locking a CWallet::cs_wallet mutex because
42+
// this could introduce inconsistent lock ordering and cause deadlocks.
4143
Mutex wallets_mutex;
4244
std::vector<std::shared_ptr<CWallet>> wallets GUARDED_BY(wallets_mutex);
4345
std::list<LoadWalletFn> wallet_load_fns GUARDED_BY(wallets_mutex);

0 commit comments

Comments
 (0)