don't display round finished when user presses pause during InputRegistrationPhase
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/CoinJoinStateViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/CoinJoinStateViewModel.cs
@@ -320,6 +320,11 @@ public partial class CoinJoinStateViewModel : ViewModelBase
{
switch (coinJoinProgress)
{
+ case RoundEndedUserPressedPause:
+ StopCountDown();
+ _stateMachine.Fire(Trigger.WalletStoppedCoinJoin);
+ break;
+
case RoundEnded roundEnded:
CurrentStatus = roundEnded.LastRoundState.EndRoundState switch
{

MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
@@ -231,6 +231,10 @@ public class CoinJoinClient
registeredAliceClientAndCircuits = await ProceedWithInputRegAndConfirmAsync(smartCoins, roundState, linkedCts.Token).ConfigureAwait(false);
}
+ catch(OperationCanceledException ex)
+ {
+ return new CoinJoinResult(false);
+ }
catch (UnexpectedRoundPhaseException ex)
{
roundState = ex.RoundState;
@@ -1089,9 +1093,12 @@ public class CoinJoinClient
throw new InvalidOperationException($"Round '{roundState.Id}' is missing.");
}
+ if(!result.IsDefaultOrEmpty)
+ {
// Be aware: at this point we are already in connection confirmation and all the coins got their first confirmation, so this is not exactly the starting time of the phase.
var estimatedRemainingFromConnectionConfirmation = DateTimeOffset.UtcNow + roundState.CoinjoinState.Parameters.ConnectionConfirmationTimeout;
CoinJoinClientProgress.SafeInvoke(this, new EnteringConnectionConfirmationPhase(newRoundState, estimatedRemainingFromConnectionConfirmation));
+ }
return result;
}

ADD
WalletWasabi/WabiSabi/Client/CoinJoinProgressEvents/RoundEndedUserPressedPause.cs
+using WalletWasabi.WabiSabi.Models;
+namespace WalletWasabi.WabiSabi.Client.CoinJoinProgressEvents;
+
+public class RoundEndedUserPressedPause : RoundEnded
+{
+ public RoundEndedUserPressedPause(RoundState lastRoundState) : base(lastRoundState)
+ {
+ }
+}

MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinTracker.cs
WalletWasabi/WabiSabi/Client/CoinJoinTracker.cs
@@ -65,6 +65,11 @@ public class CoinJoinTracker : IDisposable
case LeavingCriticalPhase:
InCriticalCoinJoinState = false;
break;
+ case RoundEnded roundEnded:
+ coinJoinProgressEventArgs = IsStopped
+ ? new RoundEndedUserPressedPause(roundEnded.LastRoundState)
+ : coinJoinProgressEventArgs;
+ break;
}
WalletCoinJoinProgressChanged?.Invoke(Wallet, coinJoinProgressEventArgs);

don't display round finished when user presses pause during InputRegistrationPhase