-
Notifications
You must be signed in to change notification settings - Fork 38.7k
wallet: Avoid recursive lock in IsTrusted #19773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cd9bb59 to
0e71022
Compare
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
ryanofsky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review ACK 0e71022306ca06f3f5df7b45a725a183b9409518. Looks good, thanks for following up on previous comments. Good to see this locking become more straightforward
0e71022 to
772ea48
Compare
|
Rebased after #19289 merge. |
meshcollider
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 772ea48
|
Concept ACK. |
hebasto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 772ea48, reviewed and tested on Linux Mint 20 (x86_64).
| std::set<uint256> trusted_parents; | ||
| LOCK(pwallet->cs_wallet); | ||
| return pwallet->IsTrusted(*this, trusted_parents); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| std::set<uint256> trusted_parents; | |
| LOCK(pwallet->cs_wallet); | |
| return pwallet->IsTrusted(*this, trusted_parents); | |
| AssertLockNotHeld(pwallet->cs_wallet); | |
| std::set<uint256> trusted_parents; | |
| LOCK(pwallet->cs_wallet); | |
| return pwallet->IsTrusted(*this, trusted_parents); |
772ea48 wallet: Avoid recursive lock in IsTrusted (João Barbosa) 819f10f wallet, refactor: Immutable CWalletTx::pwallet (João Barbosa) Pull request 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. Motivated by https://github.com/bitcoin/bitcoin/pull/19289/files#r473308226. ACKs for top commit: meshcollider: utACK 772ea48 hebasto: ACK 772ea48, reviewed and tested on Linux Mint 20 (x86_64). Tree-SHA512: 702ffd928b2f42a8b90de398790649a5fd04e1ac3877558da928e94cdeb19134883f06c3a73a6826c11c912facf199173375a70200737e164ccaea1bec515b2a
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 [[bitcoin/bitcoin#19773 | core#19773]] [1/2] bitcoin/bitcoin@819f10f 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
Summary: This is a backport of [[bitcoin/bitcoin#19773 | core#19773]] [2/2] bitcoin/bitcoin@772ea48 Backport note: `checkFinalTx` was replaced by `ContextualCheckTransactionForCurrentBlock` in D5804 Test Plan: With TSAN: `ninja all check-all` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D10100
This change moves
CWalletTx::IsTrustedtoCWalletin order to have TSAN. So nowCWallet::IsTrustedrequirescs_walletand the recursive lock no longer happens.Motivated by https://github.com/bitcoin/bitcoin/pull/19289/files#r473308226.