Page MenuHomePhabricator

wallet: Call load handlers without cs_wallet locked
ClosedPublic

Authored by Fabien on Wed, Apr 23, 15:15.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABC98e1cae7e5ca: wallet: Call load handlers without cs_wallet locked
Summary
Don't have cs_wallet locked while calling each context.wallet_load_fns. A load handler can always lock cs_wallet if needed.

The lock was added in 1c7e25d to satisfy TSAN. With 44c430f most of the code requiring the lock is in CWallet::AttachChain. A comment is added to warn about wallets_mutex and cs_wallet lock ordering.

Backport of core#22868.

Test Plan

With clang and debug:

ninja all check-all

Run the tsan build.