lock y too (and with referenceequals make sure the locks arent the same)
MODIFY
WalletWasabi/Blockchain/Analysis/Clustering/Cluster.cs
WalletWasabi/Blockchain/Analysis/Clustering/Cluster.cs
@@ -90,17 +90,14 @@ namespace WalletWasabi.Blockchain.Analysis.Clustering
public static bool operator ==(Cluster x, Cluster y)
{
- if (x is null)
- {
- if (y is null)
+ if (ReferenceEquals(x, y))
{
return true;
}
- else
+ else if (x is null)
{
return false;
}
- }
else
{
if (y is null)
@@ -110,12 +107,15 @@ namespace WalletWasabi.Blockchain.Analysis.Clustering
else
{
lock (x.Lock)
+ {
+ lock (y.Lock)
{
return x.Coins.SequenceEqual(y.Coins);
}
}
}
}
+ }
public static bool operator !=(Cluster x, Cluster y) => !(x == y);

lock y too (and with referenceequals make sure the locks arent the same)