wallet: Check specified wallet exists before migration
The previous error message for non-existent wallets of "Already a descriptor wallet" is misleading. Return a more specific error when a non-existent wallet is specified.
This commit is contained in:
1 parent
c9e67e214f
commit
f42ec0f3bf
1 file changed
+3
@@ -4407,6 +4407,9 @@ util::Result<MigrationResult> MigrateLegacyToDescriptor(const std::string& walle
|
||||
if (!wallet_path) {
|
||||
return util::Error{util::ErrorString(wallet_path)};
|
||||
}
|
||||
if (!fs::exists(*wallet_path)) {
|
||||
return util::Error{_("Error: Wallet does not exist")};
|
||||
}
|
||||
if (!IsBDBFile(BDBDataFile(*wallet_path))) {
|
||||
return util::Error{_("Error: This wallet is already a descriptor wallet")};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user