Repository navigation
wallet, refactor: modularise wallet by extracting out legacy wallet migration - #34909
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 places where named args for integral literals may be used (e.g.
2026-11-23 09:54:33 |
|
Fixed two things:
|
|
Pushed an update where three more migration specific |
5e14f7f to
60136a6
Compare
|
Rebased over master to incorporate changes from #36397. |
achow101
left a comment
There was a problem hiding this comment.
I think it would be better if we could put all of the legacy wallet migration stuff into its own subdirectory, e.g. src/wallet/legacy/ rather than having the multiple migration related files in the main wallet module directory. This would let us separate out all of the migration things without polluting the main module with these files, especially as there are more things that can be pulled out (in future PRs) from database things.
from wallet/wallet.cpp to wallet/migration.cpp. This patch should be reviewed with --color-moved=dimmed-zebra option.
…lletutil.h Couple of functions had to be made non-static for them to be used by wallet/wallet. This patch should be reviewed with --color-moved=dimmed-zebra option.
to wallet/migration. Also, update the includes in the call sites. This patch should be reviewed with --color-moved=dimmed-zebra.
to wallet/migration. This patch should be reviewed with --color-moved=dimmed-zebra.
The wallet/migrate.h|cpp file contain all the code related to the Berkeley DB that was used in the legacy wallets. Although it's true that this code is used only within the context of wallet migration but the name of the file is not exact. This patch renames the file to legacybdb so that the intent is clearer in the call sites. I felt this rename might be necessary so that the name doesn't conflict with the new migration.cpp introduced in the preceding commits.
|
Rebased over master to fix conflicts with #36087. |
|
ACK 9fd8e54 |
|
review ACK 9fd8e54 🥗 Show signatureSignature: |
|
#34193 😭. Painful rebase. |

I've been meaning to scratch this itch for quite some time. It has been noted
by many developers that the
wallet/wallet.cppfile is quite hard to reasonabout.
It is more than 4500 lines long currently and this patch is an attempt to
shortern it by around 800 lines by extracting out the wallet migration code into
a dedicated
wallet/migration.cppfile.The other benefits of this PR I see are that it moves the legacy wallet stuff
from the main wallet file that paves the way for it being descriptor specific
(as much as possible), and makes legacy wallet migration code a first-class
citizen in its own file.
I hope it makes it easier for everyone to go through the main wallet file.
This patchset should be reviewed with --color-moved=dimmed-zebra option.