Skip to content

Commit f42ec0f

Browse files
committed
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.
1 parent c9e67e2 commit f42ec0f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/wallet/wallet.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -4407,6 +4407,9 @@ util::Result<MigrationResult> MigrateLegacyToDescriptor(const std::string& walle
44074407
if (!wallet_path) {
44084408
return util::Error{util::ErrorString(wallet_path)};
44094409
}
4410+
if (!fs::exists(*wallet_path)) {
4411+
return util::Error{_("Error: Wallet does not exist")};
4412+
}
44104413
if (!IsBDBFile(BDBDataFile(*wallet_path))) {
44114414
return util::Error{_("Error: This wallet is already a descriptor wallet")};
44124415
}

0 commit comments

Comments
 (0)