diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index ef68d21cd8e..203d61df61a 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4552,7 +4552,7 @@ util::Result MigrateLegacyToDescriptor(std::shared_ptr success = reload_wallet(res.solvables_wallet); } } - if (!success) { + if (!success && !in_memory) { // Migration failed, cleanup // Before deleting the wallet's directory, copy the backup file to the top-level wallets dir fs::path temp_backup_location = fsbridge::AbsPathJoin(GetWalletDir(), backup_filename);