wallet: remove dead code in legacy wallet migration - #32758
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32758. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. 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. |
38f74e1 to
67845e0
Compare
commented
Jun 16, 2025
This seems unrelated as the error is |
left a comment
There was a problem hiding this comment.
Code review ACK
I've left some comments.
I think now the reload_wallet helper could be moved into the if (success) { condition:
https://github.com/bitcoin/bitcoin/blob/67845e0411241d83c770fafa933b11cf6b8b27b8/src/wallet/wallet.cpp#L4202-L4209
There was a problem hiding this comment.
This could be removed entirely if MigrateLegacyToDescriptor(std::shared_ptr<CWallet> local_wallet, ... was only called from MigrateLegacyToDescriptor(const std::string& wallet_name, ... but currently this function is also being called from the bench wallet_migration.cpp.
67845e0 to
2bd3a55
Compare
commented
Jun 17, 2025
Makes sense, I have done this. Also, ended up doing few related changes in the subsequent commits. |
2bd3a55 to
0635f10
Compare
commented
Jun 25, 2025
|
Thanks for highlighting. |
commented
Jun 25, 2025
|
ACK 0635f107c4e1442ce6b953308723b58044c558df |
A discussion on a previous PR 32481 related to legacy wallet dead code removal made me realize that checking if the legacy wallet was loaded prior to the start of the migration is not required ever since legacy wallets can't be loaded in the first place. I also verified that the `load_on_start` persistent setting can also not cause the legacy wallets to be loaded, which further makes the case for removal of the above mentioned checks during migration. The current test coverage also shows these lines uncovered.
commented
Jul 3, 2025
|
Rebased over master to incorporate changes from #31423. |
Also, update related comments because a reload is not happening anymore. It is done because the legacy wallets could not have been loaded prior to migration, so I don't think a reload is happening post a successful migration, it's just load IMO.
commented
Jul 10, 2025
|
ACK 150b5c9 |
A discussion on a previous PR 32481 related to legacy wallet dead
code removal made me realize that checking if the legacy
wallet was loaded prior to the start of the migration is not
required ever since legacy wallets can't be loaded in the first
place. I also verified that the
load_on_startpersistentsetting can also not cause the legacy wallets to be loaded, which
further makes the case for removal of the above mentioned checks
during migration.
The current test coverage also shows these lines uncovered.