-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Prevent wallet unload on GetWalletForJSONRPCRequest #24678
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
Don't extend shared ownership of all wallets to GetWalletForJSONRPCRequest scope.
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 f59959e
The reasoning for this change, as far as I understood this PR, is this:
- In the
GetWalletForJSONRPCRequest
function, we only needed the wallet shared pointer if the number of context wallets equals one. In other cases, we would like to return an error. - So for this, we would not like this function to have information about all the wallets corresponding to context.
- That is why this PR suggests moving this process of unloading all wallets and returning a single one to a function in the wallet.cpp file.
I have checked that the changed code is clean and clear to reason with. And if my original understanding of this PR is correct, I think this PR can be merged. And in case my analysis was erroneous, please do correct me.
What do you mean by "unload" in this context? |
The actual wallet unload, which occurs on the last shared pointer. |
Oh, I see. Is there a scenario where this could actually happen, and if so, can we test for it? |
Could happen when an explicit unload races with other call of any wallet. I don't think we can test without code changes. |
ACK f59959e |
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.
Concept and code-review ACK f59959e
f59959e wallet: Prevent wallet unload on GetWalletForJSONRPCRequest (João Barbosa) Pull request description: Don't extend shared ownership of all wallets to `GetWalletForJSONRPCRequest` scope. ACKs for top commit: achow101: ACK f59959e shaavan: Code Review ACK f59959e theStack: Concept and code-review ACK f59959e Tree-SHA512: 7c0294098b5c32acaab8cc6fcf17a581d580ad1a557ba0602a9506074ac035815739afb4a25b3e61be9132535c7fc3ec7ef5137c1dfc9d4078f13663d508ef55
Don't extend shared ownership of all wallets to
GetWalletForJSONRPCRequest
scope.