wallet, refactor: Immutable CWalletTx::pwallet
Summary:
PR description:
This change moves CWalletTx::IsTrusted to CWallet in order to have TSAN. So now CWallet::IsTrusted requires cs_wallet and the recursive lock no longer happens.
This is a backport of core#19773 [1/2]
https://github.com/bitcoin/bitcoin/pull/19773/commits/819f10f6718659eeeec13af2ce831df3a0984090
Depends on D10097
Test Plan:
With TSAN:
ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D10099