Skip to content

wallet, refactor: Remove Legacy wallet unused warnings and errors #32481

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

pablomartin4btc
Copy link
Member

@pablomartin4btc pablomartin4btc commented May 13, 2025

Remove dead code due to legacy wallet support removal.

These changes have no impact on functionality. They are transparent to the end user, as legacy wallets can't be created or loaded anymore, so these checks are no longer reached. The legacy-to-descriptor wallet migration flow is not affected either, as these removals are not part of its process.

@DrahtBot
Copy link
Contributor

DrahtBot commented May 13, 2025

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32481.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK rkrux, achow101

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #28333 (wallet: Construct ScriptPubKeyMans with all data rather than loaded progressively by achow101)

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.

@DrahtBot
Copy link
Contributor

🚧 At least one of the CI tasks failed.
Task lint: https://github.com/bitcoin/bitcoin/runs/42142854745
LLM reason (✨ experimental): The CI failure is due to trailing whitespace and spelling errors identified by the lint check.

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

@pablomartin4btc pablomartin4btc force-pushed the wallet-remove-legacy-warnings-and-errors branch 2 times, most recently from a483558 to e66e9ee Compare May 13, 2025 14:59
@pablomartin4btc pablomartin4btc force-pushed the wallet-remove-legacy-warnings-and-errors branch 2 times, most recently from 1c0ab13 to 3909051 Compare May 13, 2025 19:43
@pablomartin4btc
Copy link
Member Author

Updates:

  • Addressed @achow101's feedback by adding an Assert() on CreateWallet() enforcing only descriptor wallets can be created.

@pablomartin4btc pablomartin4btc force-pushed the wallet-remove-legacy-warnings-and-errors branch from 3909051 to dbc8427 Compare May 16, 2025 18:21
@pablomartin4btc
Copy link
Member Author

Addressed feedback removing unnecessary descriptor wallet checks.

@pablomartin4btc pablomartin4btc force-pushed the wallet-remove-legacy-warnings-and-errors branch from dbc8427 to 5466936 Compare June 9, 2025 23:33
@pablomartin4btc
Copy link
Member Author

Updates:

Copy link
Contributor

@rkrux rkrux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good based on a cursory glance, will take a deeper look soon.
Maybe mention a note in the PR description about wallet migration and how removing these checks don't affect that flow?

@pablomartin4btc pablomartin4btc force-pushed the wallet-remove-legacy-warnings-and-errors branch from 5466936 to c89e583 Compare June 10, 2025 17:20
Remove dead code due to legacy wallet removal.
SetupGeneration was supposed to be the function that all SPKMs used
to setup automatic generation, but it didn't work out that way and
ended up being legacy only. It should be deleted at this point.
It is not possible to load a legacy/ non-descriptor wallet anymore
so no need to check for WALLET_FLAG_DESCRIPTORS in RPC calls, even when
passing -rpcwallet/ JSON `/wallet/<walletname>/` endpoint, that searches
for the wallets loaded already in the context.
@pablomartin4btc pablomartin4btc force-pushed the wallet-remove-legacy-warnings-and-errors branch from c89e583 to ce90f0c Compare June 10, 2025 19:34
@pablomartin4btc
Copy link
Member Author

Updates:

Copy link
Contributor

@rkrux rkrux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK ce90f0c

Looks fine to me, I navigated through the codebase to verify the diff's correctness. Suggested one more dead code removal if makes sense.

@achow101
Copy link
Member

ACK ce90f0c

@achow101 achow101 merged commit 2def858 into bitcoin:master Jun 14, 2025
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants