Make sure of thread safety
MODIFY
WalletWasabi/CoinJoin/Client/Clients/CoinJoinClient.cs
WalletWasabi/CoinJoin/Client/Clients/CoinJoinClient.cs
@@ -691,13 +691,20 @@ namespace WalletWasabi.CoinJoin.Client.Clients
// Remove non-locked exposed keys.
foreach (var key in ExposedLinks.Keys.ToArray())
{
- ExposedLinks[key] = ExposedLinks[key].Where(x => x.Key.KeyState == KeyState.Locked).ToArray();
- if (!ExposedLinks[key].Any())
+ if (ExposedLinks.TryGetValue(key, out var links))
+ {
+ var lockedKeys = links.Where(x => x.Key.KeyState == KeyState.Locked).ToArray();
+ if (lockedKeys.Any())
+ {
+ ExposedLinks.AddOrReplace(key, lockedKeys);
+ }
+ else
{
ExposedLinks.TryRemove(key, out _);
}
}
}
+ }
public async Task QueueCoinsToMixAsync(params SmartCoin[] coins)
=> await QueueCoinsToMixAsync(coins as IEnumerable<SmartCoin>).ConfigureAwait(false);

Make sure of thread safety