Repository navigation
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste 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. LLM Linter (✨ experimental)Possible typos and grammar issues:
Possible places where named args for integral literals may be used (e.g.
2026-11-30 23:04:02 |
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
59fd473 to
e27ef87
Compare
5a5b797 to
8844dd8
Compare
8844dd8 to
79b5c85
Compare
7d6b709 to
d5a3f21
Compare
Instead of erasing legacy wallet records and tx records from the migrated database, skip copying these records in the first place.
Instead copying all of the address book entries and deleting the ones that are no longer relevant, avoid writing the address book entries in the first place and write only the ones that are relevant to the migrated wallets.
HasLegacyRecords is only used by LoadLegacyWalletRecords to check whether a descriptor wallet has any legacy wallet records. This does not require a CWallet, and is no longer called by anything outside of walletdb.cpp.
Put all legacy wallet migration related code into a custom namespace to clearly delineate which functions are migration and which are not, and to prevent accidentally calling into migration functions from outside of migration.
Instead of calling CWallet::LoadExisting, use a custom loading function for migration only that does fewer things. This will be used in later commits to implement a custom, migration specific, loading flow.
LegacyWallet owns all of the wallet migration functions so that they do not need to live in CWallet anymore.
Reordering transactions is something that only legacy wallets will need to do. All newly created descriptor wallets will have transactions with order information. Migrated descriptor wallets will have computed the order information during migration, and the updated tx records are written to the new wallet, so always contain the order information.
When migrating a legacy wallet, there is no need to try to write anything back into the legacy wallet, it won't work anyways.
d5a3f21 to
af54bd9
Compare

Originally, legacy wallet migration was built upon the foundation of being able to load legacy wallets. Now that we no longer support loading legacy wallets, there is no reason to keep any of the legacy wallet loading and migration code in the main wallet objects. Having this co-mingling of never-to-be-changed legacy wallet code and new descriptor wallet code makes it difficult to implement new things into the wallet.
This PR fully separates out all of the legacy wallet related things into a subdirectory
wallet/legacy, with everything in that directory under awallet::legacy_migrationnamespace so as to prevent accidental usage outside of legacy wallets. This includes a little bit of duplication with current loading code, but not that much, and we are able to both remove unrelated descriptor wallet loading from the legacy wallet loading, and unrelated legacy wallet loading from normal descriptor wallet loading.LegacyWalletis introduced as a subclass ofCWalletwhich contains all of the relevant legacy wallet and migration functions so thatCWalletcannot accidentally use some legacy wallet function. Additionally,LegacyDataSPKMis moved into a new file and this new namespace so that it cannot be used outside of migration.Lastly,
ReorderTransactionsis a legacy wallet only function that is also moved intoLegacyWallet.Builds upon #34909, and depends on #36823 for removing some functions that were previously used by migration.