Add try/catch to Arena step methods
MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
@@ -100,6 +100,8 @@ namespace WalletWasabi.WabiSabi.Backend.Rounds
private async Task StepConnectionConfirmationPhaseAsync(CancellationToken cancel)
{
foreach (var round in Rounds.Where(x => x.Phase == Phase.ConnectionConfirmation).ToArray())
+ {
+ try
{
if (round.Alices.All(x => x.ConfirmedConnection))
{
@@ -141,11 +143,19 @@ namespace WalletWasabi.WabiSabi.Backend.Rounds
}
}
}
+ catch (Exception ex)
+ {
+ round.SetPhase(Phase.Ended);
+ round.LogError(ex.Message);
+ }
+ }
}
private void StepOutputRegistrationPhase()
{
foreach (var round in Rounds.Where(x => x.Phase == Phase.OutputRegistration).ToArray())
+ {
+ try
{
var allReady = round.Alices.All(a => a.ReadyToSign);
@@ -174,6 +184,12 @@ namespace WalletWasabi.WabiSabi.Backend.Rounds
round.SetPhase(Phase.TransactionSigning);
}
}
+ catch (Exception ex)
+ {
+ round.SetPhase(Phase.Ended);
+ round.LogError(ex.Message);
+ }
+ }
}
private async Task StepTransactionSigningPhaseAsync(CancellationToken cancellationToken)

MODIFY
WalletWasabi/WabiSabi/LoggerTools.cs
WalletWasabi/WabiSabi/LoggerTools.cs
@@ -20,5 +20,10 @@ namespace WalletWasabi.WabiSabi
{
Log(round, LogLevel.Warning, logMessage, callerFilePath: callerFilePath, callerLineNumber: callerLineNumber);
}
+
+ public static void LogError(this Round round, string logMessage, [CallerFilePath] string callerFilePath = "", [CallerLineNumber] int callerLineNumber = -1)
+ {
+ Log(round, LogLevel.Error, logMessage, callerFilePath: callerFilePath, callerLineNumber: callerLineNumber);
+ }
}
}

Add try/catch to Arena step methods