Improve Stop
MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
@@ -80,12 +80,12 @@ namespace WalletWasabi.WabiSabi.Client
aliceClients = await ConfirmConnectionsAsync(aliceClients, cancellationToken).ConfigureAwait(false);
// Output registration.
- RoundState = await RoundStatusUpdater.CreateRoundAwaiter(RoundId, rs => rs.Phase == Phase.OutputRegistration).ConfigureAwait(false);
+ RoundState = await RoundStatusUpdater.CreateRoundAwaiter(RoundId, rs => rs.Phase == Phase.OutputRegistration, cancellationToken).ConfigureAwait(false);
var outputsWithCredentials = outputs.Zip(aliceClients, (output, alice) => (output, alice.RealAmountCredentials, alice.RealVsizeCredentials));
await RegisterOutputsAsync(outputsWithCredentials, cancellationToken).ConfigureAwait(false);
// Signing.
- RoundState = await RoundStatusUpdater.CreateRoundAwaiter(RoundId, rs => rs.Phase == Phase.TransactionSigning).ConfigureAwait(false);
+ RoundState = await RoundStatusUpdater.CreateRoundAwaiter(RoundId, rs => rs.Phase == Phase.TransactionSigning, cancellationToken).ConfigureAwait(false);
var signingState = RoundState.Assert<SigningState>();
var unsignedCoinJoin = signingState.CreateUnsignedTransaction();

MODIFY
WalletWasabi/WabiSabi/Client/RoundStatusUpdater.cs
WalletWasabi/WabiSabi/Client/RoundStatusUpdater.cs
@@ -111,5 +111,14 @@ namespace WalletWasabi.WabiSabi.Client
return tcs.Task;
}
+
+ public override Task StopAsync(CancellationToken cancellationToken)
+ {
+ foreach (var t in Awaiters.SelectMany(a => a.Value).Select(a => a.Task))
+ {
+ t.TrySetCanceled(cancellationToken);
+ }
+ return base.StopAsync(cancellationToken);
+ }
}
}

Improve Stop