[WIP] UI shows red circles if the mixing failed
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
@@ -214,7 +214,11 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
RoundId = mostAdvancedRound.State.RoundId;
SuccessfulRoundCount = mostAdvancedRound.State.SuccessfulRoundCount;
+ if (!Global.ChaumianClient.State.IsInErrorState)
+ {
Phase = mostAdvancedRound.State.Phase;
+ }
+ this.RaisePropertyChanged(nameof(Phase));
PeersRegistered = mostAdvancedRound.State.RegisteredPeerCount;
PeersNeeded = mostAdvancedRound.State.RequiredPeerCount;
}
@@ -301,7 +305,9 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
public CcjRoundPhase Phase
{
get { return _phase; }
- set { this.RaiseAndSetIfChanged(ref _phase, value); }
+ set {
+ this.RaiseAndSetIfChanged(ref _phase, value);
+ }
}
public Money RequiredBTC

MODIFY
WalletWasabi.Gui/Converters/PhaseColorConverter.cs
WalletWasabi.Gui/Converters/PhaseColorConverter.cs
@@ -14,9 +14,10 @@ namespace WalletWasabi.Gui.Converters
{
if(!Enum.TryParse(typeof(CcjRoundPhase), parameter.ToString(), false, out var p))
throw new ArgumentException($"Unknown '{parameter}' value");
+ var phaseError = Global.ChaumianClient.State.IsInErrorState;
return ((CcjRoundPhase)p <= (CcjRoundPhase)value)
- ? Brushes.Green
+ ? (phaseError? Brushes.Red : Brushes.Green)
: Brushes.Gray;
}

MODIFY
WalletWasabi/Models/ChaumianCoinJoin/CcjClientState.cs
WalletWasabi/Models/ChaumianCoinJoin/CcjClientState.cs
@@ -272,7 +272,7 @@ namespace WalletWasabi.Models.ChaumianCoinJoin
public void UpdateRoundsByStates(params CcjRunningRoundState[] allRunningRoundsStates)
{
Guard.NotNullOrEmpty(nameof(allRunningRoundsStates), allRunningRoundsStates);
-
+ IsInErrorState = false;
lock (StateLock)
{
// Find the rounds those aren't running anymore
@@ -301,6 +301,13 @@ namespace WalletWasabi.Models.ChaumianCoinJoin
}
round.AliceClient?.Dispose();
+
+ var newSuccessfulRoundCount = allRunningRoundsStates.FirstOrDefault()?.SuccessfulRoundCount;
+ if (newSuccessfulRoundCount != null && round.State.SuccessfulRoundCount == newSuccessfulRoundCount)
+ {
+ IsInErrorState = true;
+ }
+
Logger.LogInfo<CcjClientState>($"Round ({round.State.RoundId}) removed. Reason: It's not running anymore.");
}
Rounds.RemoveAll(x => roundsToRemove.Contains(x.State.RoundId));
@@ -325,6 +332,8 @@ namespace WalletWasabi.Models.ChaumianCoinJoin
}
}
+ public bool IsInErrorState { get; private set; }
+
public void AddOrReplaceRound(CcjClientRound round)
{
lock (StateLock)

[WIP] UI shows red circles if the mixing failed