Call cts.Dispose() only when the wallet gets removed from the tracked list.
MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinManager.cs
WalletWasabi/WabiSabi/Client/CoinJoinManager.cs
@@ -77,7 +77,6 @@ namespace WalletWasabi.WabiSabi.Client
foreach (var closedWallet in closedWallets.Select(x => x.Value))
{
closedWallet.CancellationTokenSource.Cancel();
- closedWallet.CancellationTokenSource.Dispose();
}
var finishedCoinJoins = trackedWallets
@@ -92,8 +91,11 @@ namespace WalletWasabi.WabiSabi.Client
{
Logger.LogWarning($"Wallet: `{finishedCoinJoin.Wallet.WalletName}` was not removed from tracked wallet list. Will retry in a few seconds.");
}
+ else
+ {
finishedCoinJoin.CancellationTokenSource.Dispose();
}
+ }
foreach (var finishedCoinJoin in finishedCoinJoins)
{

Call cts.Dispose() only when the wallet gets removed from the tracked list.