mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 07:39:08 +01:00
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.
This commit is contained in:
@@ -4306,7 +4306,7 @@ util::Result<MigrationResult> MigrateLegacyToDescriptor(std::shared_ptr<CWallet>
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user