-
Notifications
You must be signed in to change notification settings - Fork 37.7k
wallet: Tidy CWallet::SetUsedDestinationState #17354
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
wallet: Tidy CWallet::SetUsedDestinationState #17354
Conversation
I've noticed that |
Maybe we should add |
db7a4c3
to
bd0b305
Compare
bd0b305
to
0b75a7f
Compare
@achow101 @meshcollider friendly review request. |
I'd like this convention since it would make it clearer which methods could hit the database. I'd like it even more if it was extended to methods that read and didn't just mutate the database and was extended to KeyMan and SigningProvider classes so the ugly |
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 0b75a7f. Code changes looks fine but PR description should be updated to say what benefits of the change are. I might have missed something, but I didn't see a place where multiple batches were used previously and a single batch was used now. So the main benefit of this change appears to be removing a recursive lock? And maybe moving toward a consistent convention for passing batch instances?
@ryanofsky original goal was to remove the recursive lock. Note that now Thanks for the review! Updated OP. |
Good to mention the motivation and brag about improvements like this in the PR description. It helps to understand the change and motivate reviews |
I understand that you support this, if others also then I can follow up - just add 👍 here. |
ACK 0b75a7f |
1 similar comment
ACK 0b75a7f |
0b75a7f wallet: Reuse existing batch in CWallet::SetUsedDestinationState (João Barbosa) 01f45dd wallet: Avoid recursive lock in CWallet::SetUsedDestinationState (João Barbosa) Pull request description: This PR makes 2 distinct changes around `CWallet::SetUsedDestinationState`: - 1st the recursive lock is removed and now it requires the lock to be held; - 2nd change is to support, in the best case, just a wallet database flush when transaction is added to the wallet. ACKs for top commit: achow101: ACK 0b75a7f MarcoFalke: ACK 0b75a7f ryanofsky: Code review ACK 0b75a7f. Code changes looks fine but PR description should be updated to say what benefits of the change are. I might have missed something, but I didn't see a place where multiple batches were used previously and a single batch was used now. So the main benefit of this change appears to be removing a recursive lock? And maybe moving toward a consistent convention for passing batch instances? Tree-SHA512: abcf23a5850d29990668db20d6f624cca3e89629cc9ed003e0d05cde1b58ab2ff365034f156684ad13e55764b54c6c0c2bc7d5f96b8af7dc5e45a3be955d6b15
0b75a7f wallet: Reuse existing batch in CWallet::SetUsedDestinationState (João Barbosa) 01f45dd wallet: Avoid recursive lock in CWallet::SetUsedDestinationState (João Barbosa) Pull request description: This PR makes 2 distinct changes around `CWallet::SetUsedDestinationState`: - 1st the recursive lock is removed and now it requires the lock to be held; - 2nd change is to support, in the best case, just a wallet database flush when transaction is added to the wallet. ACKs for top commit: achow101: ACK 0b75a7f MarcoFalke: ACK 0b75a7f ryanofsky: Code review ACK 0b75a7f. Code changes looks fine but PR description should be updated to say what benefits of the change are. I might have missed something, but I didn't see a place where multiple batches were used previously and a single batch was used now. So the main benefit of this change appears to be removing a recursive lock? And maybe moving toward a consistent convention for passing batch instances? Tree-SHA512: abcf23a5850d29990668db20d6f624cca3e89629cc9ed003e0d05cde1b58ab2ff365034f156684ad13e55764b54c6c0c2bc7d5f96b8af7dc5e45a3be955d6b15
Summary: * wallet: Avoid recursive lock in CWallet::SetUsedDestinationState * wallet: Reuse existing batch in CWallet::SetUsedDestinationState This is a backport of Core [[bitcoin/bitcoin#17354 | PR17354]] Test Plan: ninja all check-all Reviewers: #bitcoin_abc, majcosta Reviewed By: #bitcoin_abc, majcosta Differential Revision: https://reviews.bitcoinabc.org/D7529
0b75a7f wallet: Reuse existing batch in CWallet::SetUsedDestinationState (João Barbosa) 01f45dd wallet: Avoid recursive lock in CWallet::SetUsedDestinationState (João Barbosa) Pull request description: This PR makes 2 distinct changes around `CWallet::SetUsedDestinationState`: - 1st the recursive lock is removed and now it requires the lock to be held; - 2nd change is to support, in the best case, just a wallet database flush when transaction is added to the wallet. ACKs for top commit: achow101: ACK 0b75a7f MarcoFalke: ACK 0b75a7f ryanofsky: Code review ACK 0b75a7f. Code changes looks fine but PR description should be updated to say what benefits of the change are. I might have missed something, but I didn't see a place where multiple batches were used previously and a single batch was used now. So the main benefit of this change appears to be removing a recursive lock? And maybe moving toward a consistent convention for passing batch instances? Tree-SHA512: abcf23a5850d29990668db20d6f624cca3e89629cc9ed003e0d05cde1b58ab2ff365034f156684ad13e55764b54c6c0c2bc7d5f96b8af7dc5e45a3be955d6b15
This PR makes 2 distinct changes around
CWallet::SetUsedDestinationState
: