mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-05 21:21:17 +00: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:
parent
184159e4f3
commit
8a4cfddf23
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user