HomePhabricator

wallet: Call load handlers without cs_wallet locked

Description

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.

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D17980

Details

Provenance
João Barbosa <joao.paulo.barbosa@gmail.com>Authored on Sep 2 2021, 22:11
FabienCommitted on Wed, Apr 23, 18:49
teamcityPushed on Wed, Apr 23, 18:54
Parents
rSTAGING79f659739aab: [doc] Add productivity note about utilizing the ramdisk for faster testing
Branches
Unknown
Tags
Unknown

Event Timeline