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.