Late requests after round eneded.
MODIFY
WalletWasabi/WabiSabi/Backend/Models/WrongPhaseException.cs
WalletWasabi/WabiSabi/Backend/Models/WrongPhaseException.cs
@@ -15,18 +15,20 @@ public class WrongPhaseException : WabiSabiProtocolException
public Phase[] ExpectedPhases { get; }
public uint256 RoundId { get; }
- public WrongPhaseException(Round round, params Phase[] expectedPhases) : base(WabiSabiProtocolErrorCode.WrongPhase, $"Round ({round.Id}): Wrong phase ({round.Phase}).")
+ public WrongPhaseException(Round round, params Phase[] expectedPhases)
+ : base(WabiSabiProtocolErrorCode.WrongPhase, $"Round ({round.Id}): Wrong phase ({round.Phase}).")
{
- var latestExpectedPhase = expectedPhases.OrderBy(p => (int)p).Last();
+ var latestExpectedPhase = expectedPhases.MaxBy(p => (int)p);
var now = DateTimeOffset.UtcNow;
- Late = latestExpectedPhase switch
+ var endTime = latestExpectedPhase switch
{
Phase.InputRegistration => now - round.InputRegistrationTimeFrame.EndTime,
Phase.ConnectionConfirmation => now - round.ConnectionConfirmationTimeFrame.EndTime,
Phase.OutputRegistration => now - round.OutputRegistrationTimeFrame.EndTime,
Phase.TransactionSigning => now - round.TransactionSigningTimeFrame.EndTime,
- _ => TimeSpan.MaxValue
+ Phase.Ended => now - round.End,
+ _ => throw new ArgumentException($"Unknown Phase {latestExpectedPhase}.")
};
CurrentPhase = round.Phase;

Late requests after round eneded.