mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-09 11:27:28 -03:00
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:
parent
c9e67e214f
commit
f42ec0f3bf
1 changed files with 3 additions and 0 deletions
|
@ -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")};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue