-
Notifications
You must be signed in to change notification settings - Fork 310
gui: Add a menu action to restore then migrate a legacy wallet #877
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
base: master
Are you sure you want to change the base?
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. 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. |
7da603a
to
7c0bb7f
Compare
🚧 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. |
Good idea. I had this happen to me just recently. I encountered a Catch-22: couldn't restore an old wallet file because it wasn't in a currently recognized format (it told me to use the migrate wallet option instead), but I also couldn't access the wallet in the migrate menu because it hadn't successfully been loaded yet! I tried manually copying the |
IMO this is bad UX. Users will be looking to restore the wallet, and the details of how it does that shouldn't require unintuitive steps. |
While it is an extra click, I don't think it is unintuitive. When the user goes to restore a legacy wallet, they will be informed that the restore failed and that they will need to migrate the wallet via the corresponding menu. When the user goes there, this option to restore and migrate will be presented to them. |
7c0bb7f
to
56407ca
Compare
I support the proposal, but I also consider that this extra click is a bad experience for the user. The ideal would be to directly integrate this functionality to automatically detect if it is a legacy wallet and offer the migration option in the same flow. If you need someone on your team I am available. |
If you copy the
It's no longer possible to load a legacy wallet on the
Just tried and it works, if you launched QT with a test chain you need to add that into the path (eg if you used -regtest, the wallets dir path would be /datadir/regtest/wallets). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK 56407ca
I'll try to review the code later (first commit is not longer needed, perhaps rebase?).
Regarding the approach IMHO:
integrate this functionality to automatically detect if it is a legacy wallet and offer the migration option in the same flow.
I thought the same at first glance as an additional to the current PR logic, if the user knows that has the backup to restore maybe goes directly there first.
I'd update the menu item title to "Wallet file...", since you could restore a .dat file or migrate a backup file directly - checked with CLI
.
Perhaps @GBKS could add his view here...
RestoreWallet has a load_after_restore parameter, expose this to callers using it through the wallet interface as well.
We will need to use the same migration code in a later commit, so first move it to a separate function.
restore_and_migrate first restores a wallet file to the wallets directory in the expected layout, then it performs legacy to descriptor wallet migration on the restored wallet.
Some users will have backups of a legacy wallet which cannot be restored due to being a legacy wallet, and therefore cannot be migrated from the GUI. This menu item allows such users to restore and migrate their wallets in a single action.
56407ca
to
c02e8a3
Compare
Rebased and ready for review |
Some users will have a backup of their legacy wallet. These cannot be restored since the "Restore Wallet" action expects to be able to load the wallet after restoring, and this fails for legacy wallets now that they are deleted. Furthermore, the "Migrate Wallet" action only allows users to migrate wallets that are in the wallets directory, so such backups cannot be migrated from the GUI.
This PR resolves this issue by adding a menu item in the "Migrate Wallet" menu which allows users to select their backup file so that it will first be restored but not loaded, and then migrated.
Depends on bitcoin/bitcoin#32620