Skip to content

Commit 8a4cfdd

Browse files
committed
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.
1 parent 184159e commit 8a4cfdd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wallet/wallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4306,7 +4306,7 @@ util::Result<MigrationResult> MigrateLegacyToDescriptor(std::shared_ptr<CWallet>
43064306
success = (wallet != nullptr);
43074307

43084308
// When no wallet is set, set the main wallet.
4309-
if (!res.wallet) {
4309+
if (success && !res.wallet) {
43104310
res.wallet_name = wallet->GetName();
43114311
res.wallet = std::move(wallet);
43124312
}

0 commit comments

Comments
 (0)