wallet: init, don't error out when loading legacy wallets

Instead of failing during initialization when encountering a legacy wallet, skip
loading the wallet and notify the user accordingly.

This allows users to access migration functionalities without needing to manually
remove the wallet from settings.json or resort to using the bitcoin-wallet utility.

This means that GUI users will be able to use the migration button, and bitcoin-cli
users will be able to call the migratewallet RPC directly after init.
This commit is contained in:
furszy
2025-05-08 11:54:47 -04:00
parent 66c968b4b4
commit 9f94de5bb5
5 changed files with 16 additions and 5 deletions

View File

@@ -378,7 +378,7 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
# Restore the wallet to master
# Legacy wallets are no longer supported. Trying to load these should result in an error
assert_raises_rpc_error(-18, "The wallet appears to be a Legacy wallet, please use the wallet migration tool (migratewallet RPC)", node_master.restorewallet, wallet_name, backup_path)
assert_raises_rpc_error(-18, "The wallet appears to be a Legacy wallet, please use the wallet migration tool (migratewallet RPC or the GUI option)", node_master.restorewallet, wallet_name, backup_path)
self.test_v22_inactivehdchain_path()