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:
1 parent
184159e4f3
commit
8a4cfddf23
1 file changed
+1
-1
@@ -4306,7 +4306,7 @@ util::Result<MigrationResult> MigrateLegacyToDescriptor(std::shared_ptr<CWallet>
|
|||||||
success = (wallet != nullptr);
|
success = (wallet != nullptr);
|
||||||
|
|
||||||
// When no wallet is set, set the main wallet.
|
// When no wallet is set, set the main wallet.
|
||||||
if (!res.wallet) {
|
if (success && !res.wallet) {
|
||||||
res.wallet_name = wallet->GetName();
|
res.wallet_name = wallet->GetName();
|
||||||
res.wallet = std::move(wallet);
|
res.wallet = std::move(wallet);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user