-
Notifications
You must be signed in to change notification settings - Fork 37.7k
LegacyScriptPubKeyMan code cleanups #17300
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
Suggested by João Barbosa <joao.paulo.barbosa@gmail.com> bitcoin#17260 (comment)
Suggestion from MarcoFalke <falke.marco@gmail.com> bitcoin#17260 (comment)
Suggested by MarcoFalke <falke.marco@gmail.com> bitcoin#17260 (comment)
Suggestion from MarcoFalke <falke.marco@gmail.com> bitcoin#17260 (comment)
Suggested by MarcoFalke <falke.marco@gmail.com> bitcoin#17260 (comment)
In commit aa0e6d8: My comment was just an example. It is generally not clear to me when this nullptr check should be done. Most of the other methods don't do it either. E.g. |
Checking for null key managers should always be done, and various commits in #17261 add more null checks. But I don't think it makes a big difference if we add null checks now (there should only be a small handful) or wait for changes from #17261. Just let me know what you prefer: dropping this commit, keeping it, or expanding it to cover Note Later after that, |
I like how
I prefer expanding it. |
Either drop it or expand it. It shouldn't matter |
aa0e6d8
to
53fe0b7
Compare
re: #17300 (comment) from Sjors
re: #17300 (comment) from MarcoFalke
I looked into expanding this but some of the changes in places like |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
Approach ACK, haven't looked at the diff in-depth |
ACK 53fe0b7 |
1 similar comment
ACK 53fe0b7 |
ACK 53fe0b7 Show signature and timestampSignature:
Timestamp of file with hash |
53fe0b7 Fix missing strFailReason in CreateTransaction (Russell Yanofsky) 4b28a05 Fix misplaced AssertLockHeld (Russell Yanofsky) 2632b1f doc: Clarify WalletStorage / Wallet relation (Russell Yanofsky) 628d11b Add back mistakenly removed AssertLockHeld (Russell Yanofsky) 52cf68f Refactor: Add GetLegacyScriptPubKeyMan helper (Russell Yanofsky) Pull request description: This PR implements suggested code cleanups from #17260 review comments ACKs for top commit: Sjors: ACK 53fe0b7 achow101: ACK 53fe0b7 MarcoFalke: ACK 53fe0b7 Tree-SHA512: a577b96cb21a9aa7185d7d900e4db0665c302adcd12097957b9d8e838a8548c7de8f901bcb83e7c46d231b841221345c9264f5e29ed069f3d9236896430f959b
53fe0b7 Fix missing strFailReason in CreateTransaction (Russell Yanofsky) 4b28a05 Fix misplaced AssertLockHeld (Russell Yanofsky) 2632b1f doc: Clarify WalletStorage / Wallet relation (Russell Yanofsky) 628d11b Add back mistakenly removed AssertLockHeld (Russell Yanofsky) 52cf68f Refactor: Add GetLegacyScriptPubKeyMan helper (Russell Yanofsky) Pull request description: This PR implements suggested code cleanups from bitcoin#17260 review comments ACKs for top commit: Sjors: ACK 53fe0b7 achow101: ACK 53fe0b7 MarcoFalke: ACK 53fe0b7 Tree-SHA512: a577b96cb21a9aa7185d7d900e4db0665c302adcd12097957b9d8e838a8548c7de8f901bcb83e7c46d231b841221345c9264f5e29ed069f3d9236896430f959b
This introduces 5 "warning: unused variable 'spk_man' [-Wunused-variable]" warnings in rpcdump. Probably harmless: though if the function should be called if the return value is not used (so it's purely side effect) it might be good to document that so people don't do the obvious thing. |
Follow-up to bitcoin#17300 "LegacyScriptPubKeyMan code cleanups".
Good catch. I'm planning to make another cleanup PR after #17304 (which could be close to ready for merge) for more unaddressed review comments. I could fix the warning in that PR, or open a more limited PR sooner if the warnings are too annoying. Some of the unused |
05b224a Add missing SetupGeneration error handling in EncryptWallet (Russell Yanofsky) bfd826a Clean up nested scope in GetReservedDestination (Russell Yanofsky) 491a599 Get rid of confusing LegacyScriptPubKeyMan::TopUpKeyPool method (Russell Yanofsky) 4a0abf6 Pass CTxDestination to ScriptPubKeyMan::GetMetadata (Russell Yanofsky) b07b07c Add EnsureLegacyScriptPubKeyMan and use in rpcwallet.cpp (Russell Yanofsky) Pull request description: This PR implements suggested code cleanups from #17300 and #17304 review comments ACKs for top commit: Sjors: re-ACK 05b224a laanwj: Code review ACK 05b224a Tree-SHA512: 12fd86637088515b744c028e0501c5d21a9cf9ee9c9cfd70e9cb65d44611ea5643abd5f6f101105caa5aff015d74de606f074f08af7dae8429f929d21288ab45
05b224a Add missing SetupGeneration error handling in EncryptWallet (Russell Yanofsky) bfd826a Clean up nested scope in GetReservedDestination (Russell Yanofsky) 491a599 Get rid of confusing LegacyScriptPubKeyMan::TopUpKeyPool method (Russell Yanofsky) 4a0abf6 Pass CTxDestination to ScriptPubKeyMan::GetMetadata (Russell Yanofsky) b07b07c Add EnsureLegacyScriptPubKeyMan and use in rpcwallet.cpp (Russell Yanofsky) Pull request description: This PR implements suggested code cleanups from bitcoin#17300 and bitcoin#17304 review comments ACKs for top commit: Sjors: re-ACK 05b224a laanwj: Code review ACK 05b224a Tree-SHA512: 12fd86637088515b744c028e0501c5d21a9cf9ee9c9cfd70e9cb65d44611ea5643abd5f6f101105caa5aff015d74de606f074f08af7dae8429f929d21288ab45
Summary: Fix missing strFailReason in CreateTransaction (Russell Yanofsky) Fix misplaced AssertLockHeld (Russell Yanofsky) doc: Clarify WalletStorage / Wallet relation (Russell Yanofsky) Add back mistakenly removed AssertLockHeld (Russell Yanofsky) Refactor: Add GetLegacyScriptPubKeyMan helper (Russell Yanofsky) Pull request description: This PR implements suggested code cleanups from bitcoin/bitcoin#17260 review comments --- https://github.com/bitcoin/bitcoin/pull/17300/files Depends on D7119 Backport of Core [[bitcoin/bitcoin#17300 | PR17300]] Test Plan: ninja check check-functional Reviewers: #bitcoin_abc, jasonbcox Reviewed By: #bitcoin_abc, jasonbcox Differential Revision: https://reviews.bitcoinabc.org/D7128
53fe0b7 Fix missing strFailReason in CreateTransaction (Russell Yanofsky) 4b28a05 Fix misplaced AssertLockHeld (Russell Yanofsky) 2632b1f doc: Clarify WalletStorage / Wallet relation (Russell Yanofsky) 628d11b Add back mistakenly removed AssertLockHeld (Russell Yanofsky) 52cf68f Refactor: Add GetLegacyScriptPubKeyMan helper (Russell Yanofsky) Pull request description: This PR implements suggested code cleanups from bitcoin#17260 review comments ACKs for top commit: Sjors: ACK 53fe0b7 achow101: ACK 53fe0b7 MarcoFalke: ACK 53fe0b7 Tree-SHA512: a577b96cb21a9aa7185d7d900e4db0665c302adcd12097957b9d8e838a8548c7de8f901bcb83e7c46d231b841221345c9264f5e29ed069f3d9236896430f959b
05b224a Add missing SetupGeneration error handling in EncryptWallet (Russell Yanofsky) bfd826a Clean up nested scope in GetReservedDestination (Russell Yanofsky) 491a599 Get rid of confusing LegacyScriptPubKeyMan::TopUpKeyPool method (Russell Yanofsky) 4a0abf6 Pass CTxDestination to ScriptPubKeyMan::GetMetadata (Russell Yanofsky) b07b07c Add EnsureLegacyScriptPubKeyMan and use in rpcwallet.cpp (Russell Yanofsky) Pull request description: This PR implements suggested code cleanups from bitcoin#17300 and bitcoin#17304 review comments ACKs for top commit: Sjors: re-ACK 05b224a laanwj: Code review ACK 05b224a Tree-SHA512: 12fd86637088515b744c028e0501c5d21a9cf9ee9c9cfd70e9cb65d44611ea5643abd5f6f101105caa5aff015d74de606f074f08af7dae8429f929d21288ab45
This PR implements suggested code cleanups from #17260 review comments