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.
Motivated by https://github.com/bitcoin/bitcoin/pull/19289/files#r473308226.
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.
Motivated by https://github.com/bitcoin/bitcoin/pull/19289/files#r473308226.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
No conflicts as of last run.
Code review ACK 0e71022306ca06f3f5df7b45a725a183b9409518. Looks good, thanks for following up on previous comments. Good to see this locking become more straightforward
utACK 772ea4844c34ad70d02fd0bd6c0945baa8fff85c
Concept ACK.
1969 | @@ -1970,37 +1970,38 @@ bool CWalletTx::InMempool() const 1970 | 1971 | bool CWalletTx::IsTrusted() const 1972 | { 1973 | - std::set<uint256> s; 1974 | - return IsTrusted(s); 1975 | + std::set<uint256> trusted_parents; 1976 | + LOCK(pwallet->cs_wallet); 1977 | + return pwallet->IsTrusted(*this, trusted_parents);
772ea4844c34ad70d02fd0bd6c0945baa8fff85c
AssertLockNotHeld(pwallet->cs_wallet);
std::set<uint256> trusted_parents;
LOCK(pwallet->cs_wallet);
return pwallet->IsTrusted(*this, trusted_parents);
ACK 772ea4844c34ad70d02fd0bd6c0945baa8fff85c, reviewed and tested on Linux Mint 20 (x86_64).