Skip to content

Commit

Permalink
wallet: Check specified wallet exists before migration
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
achow101 committed Nov 13, 2024
1 parent c9e67e2 commit f42ec0f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")};
}
Expand Down

0 comments on commit f42ec0f

Please sign in to comment.