From 8a4cfddf23a4575a1042dfa97d3478727775e8dd Mon Sep 17 00:00:00 2001 From: Ava Chow Date: Tue, 15 Jul 2025 16:11:36 -0700 Subject: [PATCH] wallet: Set migrated wallet name only on success After a wallet is migrated and we are trying to load it, if it could not be loaded, don't try to set the wallet name. --- src/wallet/wallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 3d83f356f64..c3452f7814a 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4306,7 +4306,7 @@ util::Result MigrateLegacyToDescriptor(std::shared_ptr success = (wallet != nullptr); // When no wallet is set, set the main wallet. - if (!res.wallet) { + if (success && !res.wallet) { res.wallet_name = wallet->GetName(); res.wallet = std::move(wallet); }