Better log messages when round aborted with not enough alices
MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
@@ -321,6 +321,8 @@ public class CoinJoinClient
{
int eventInvokedAlready = 0;
+ UnexpectedRoundPhaseException? lastAbortedNotEnoughAlicesException = null;
+
var remainingInputRegTime = roundState.InputRegistrationEnd - DateTimeOffset.UtcNow;
using CancellationTokenSource strictInputRegTimeoutCts = new(remainingInputRegTime);
@@ -419,6 +421,13 @@ public class CoinJoinClient
personCircuit?.Dispose();
return (null, null);
}
+ catch (UnexpectedRoundPhaseException ex) when (ex.RoundState.EndRoundState is EndRoundState.AbortedNotEnoughAlices)
+ {
+ lastAbortedNotEnoughAlicesException = ex;
+ Logger.LogTrace(ex);
+ personCircuit?.Dispose();
+ return (null, null);
+ }
catch (Exception ex)
{
Logger.LogWarning(ex);
@@ -452,11 +461,19 @@ public class CoinJoinClient
await Task.WhenAll(aliceClients).ConfigureAwait(false);
- return aliceClients
+ var successfulAlices = aliceClients
.Select(x => x.Result)
.Where(r => r.AliceClient is not null && r.PersonCircuit is not null)
.Select(r => (r.AliceClient!, r.PersonCircuit!))
.ToImmutableArray();
+
+ if (!successfulAlices.Any() && lastAbortedNotEnoughAlicesException is { })
+ {
+ // In this case the coordinator aborted the round - throw only one exception and log outside.
+ throw lastAbortedNotEnoughAlicesException;
+ }
+
+ return successfulAlices;
}
private BobClient CreateBobClient(RoundState roundState)

Better log messages when round aborted with not enough alices