Change the return type of upgradewallet to be an object for future extensibility.
Also return any error string returned from the UpgradeWallet()
function.
Change the return type of upgradewallet to be an object for future extensibility.
Also return any error string returned from the UpgradeWallet()
function.
ACK 2ead31fb1b17c9b183a4b81f0ae4f48e5cf67d64
Thanks for picking this up to avoid a delay in the 0.21 release!
ACK, tested the upgradewallet
help and output manually both for successful and failure cases. Two thoughts: (a) it might be user-friendly to provide a message that the upgrade was successful rather than an empty JSON object with a newline in the middle, e.g. {"result": "the wallet was upgraded successfully to version 16990"}
, and (b) could add a functional test case for the result in case of an error.
0$ bitcoin-cli -regtest upgradewallet
1{
2}
0$ bitcoin-cli -regtest upgradewallet
1{
2 "error": "Cannot downgrade wallet"
3}
0$ bitcoin-cli -regtest help upgradewallet
1upgradewallet ( version )
2
3Upgrade the wallet. Upgrades to the latest version if no version number is specified
4New keys may be generated and a new wallet backup will need to be made.
5Arguments:
61. version (numeric, optional, default=169900) The version number to upgrade to. Default is the latest wallet version
7
8Result:
9{ (json object)
10 "error" : "str" (string, optional) Error message (if there is one)
11}
12
13Examples:
14> bitcoin-cli upgradewallet 169900
15> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "upgradewallet", "params": [169900]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
No conflicts as of last run.