Minor improvements for cancellation registrations
MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
@@ -291,19 +291,21 @@ public class CoinJoinClient
catch (WabiSabiProtocolException wpe)
{
if (wpe.ErrorCode == WabiSabiProtocolErrorCode.WrongPhase)
+ {
+ if (wpe.ExceptionData is WrongPhaseExceptionData wrongPhaseExceptionData)
+ {
+ if (wrongPhaseExceptionData.CurrentPhase != Phase.InputRegistration)
{
// Cancel all remaining pending input registrations because they will arrive late too.
registrationsCts.Cancel();
- if (wpe.ExceptionData is WrongPhaseExceptionData wrongPhaseExceptionData)
- {
- if (wrongPhaseExceptionData.CurrentPhase != Phase.InputRegistration
- && wrongPhaseExceptionData.CurrentPhase != Phase.ConnectionConfirmation)
+ if (wrongPhaseExceptionData.CurrentPhase != Phase.ConnectionConfirmation)
{
// Cancel all remaining pending connection confirmations because they will arrive late too.
confirmationsCts.Cancel();
}
}
+ }
else
{
throw new InvalidOperationException(

Minor improvements for cancellation registrations