Use prevState
MODIFY
WalletWasabi/Wallets/Wallet.cs
WalletWasabi/Wallets/Wallet.cs
@@ -145,9 +145,10 @@ namespace WalletWasabi.Wallets
/// <inheritdoc/>
public override async Task StartAsync(CancellationToken cancel)
{
- State = WalletState.Starting;
+ var prevState = State;
try
{
+ State = WalletState.Starting;
InitializingChanged?.Invoke(this, true);
if (!Synchronizer.IsRunning)
@@ -181,7 +182,7 @@ namespace WalletWasabi.Wallets
}
catch
{
- State = WalletState.Initialized;
+ State = prevState;
throw;
}
finally

Use prevState