Remove redundant UnexpectedRoundPhaseException
MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
@@ -209,13 +209,9 @@ public class CoinJoinClient
{
(aliceClientsThatSigned, outputTxOuts, unsignedCoinJoin) = await ProceedWithRoundAsync(roundState, smartCoins, cancellationToken).ConfigureAwait(false);
}
- catch (UnexpectedRoundPhaseException ex)
- {
- // If the actual state of the round in Ended we let the execution continue.
- if (ex.Actual != Phase.Ended)
+ catch (UnexpectedRoundPhaseException ex) when (ex.Actual == Phase.Ended)
{
- throw;
- }
+ // Do nothing - if the actual state of the round in Ended we let the execution continue.
}
roundState = await RoundStatusUpdater.CreateRoundAwaiterAsync(s => s.Id == roundId && s.Phase == Phase.Ended, cancellationToken).ConfigureAwait(false);
@@ -1104,8 +1100,6 @@ public class CoinJoinClient
// Because of the nature of the protocol, the input registration and the connection confirmation phases are done subsequently thus they have a merged timeout.
var timeUntilOutputReg = (roundState.InputRegistrationEnd - DateTimeOffset.UtcNow) + roundState.CoinjoinState.Parameters.ConnectionConfirmationTimeout;
- try
- {
using CancellationTokenSource timeUntilOutputRegCts = new(timeUntilOutputReg + ExtraPhaseTimeoutMargin);
using CancellationTokenSource linkedCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, timeUntilOutputRegCts.Token);
@@ -1128,17 +1122,4 @@ public class CoinJoinClient
return result;
}
- catch (UnexpectedRoundPhaseException ex)
- {
- roundState = ex.RoundState;
- var message = ex.RoundState.EndRoundState switch
- {
- EndRoundState.AbortedNotEnoughAlices => $"Not enough participants in the round to continue. Waiting for a new round.",
- _ => $"Registration phase ended by the coordinator: '{ex.Message}' code: '{ex.RoundState.EndRoundState}'."
- };
-
- roundState.LogInfo(message);
- return ImmutableArray<(AliceClient, PersonCircuit)>.Empty;
- }
- }
}

Remove redundant UnexpectedRoundPhaseException