Skip to content
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

Upgrade encrypted wallet #16360

Closed
wants to merge 2 commits into from

Conversation

darosior
Copy link
Member

@darosior darosior commented Jul 9, 2019

This PR:

  • makes the wallet upgrade a method of CWallet
  • adds a RPC command: upgradewallet

Rationale:
User with wallet created with old version of bitcoin-core were not able to use v0.18 because of a keypool error (#16091). If their wallet was encrypted they could not even upgrade the wallet and thus v0.18 became unusable.

Problem:
I don't know how to write a test for this feature (how can I generate an old-version wallet ?) : I could not even find a test for the wallet upgrade functionnality. However I hand-tested and succesfully upgraded with v0.18 a wallet created with 0.11.1.

@instagibbs
Copy link
Member

see #15761 which also adds the RPC

with respect to upgradewallet tests, some discussion here #12134

@darosior
Copy link
Member Author

darosior commented Jul 9, 2019

@instagibbs Thank you for the links, I didn't see this was already submitted.. I'll check it out and close this one if it has the same behavior.

This remove the wallet upgrade code from the 'CreateWalletFromFile' method to create a new wallet method: 'UpgradeWallet', which make it possible to upgrade a wallet instance outside of 'CreateWalletFromFile' and thus not only at startup.
This add a new RPC command which permits to upgrade a wallet to, by default, the latest version or to an optionally passed as a parameter version
@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 9, 2019

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #16341 (WIP: Introduce ScriptPubKeyMan interface and use it for key and script management (aka wallet boxes) by achow101)
  • #15761 (Replace -upgradewallet startup option with upgradewallet RPC 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.

@darosior
Copy link
Member Author

darosior commented Jul 9, 2019

Closing in favor of #15761

@darosior darosior closed this Jul 9, 2019
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants