Update anonymity set in a safer and more generic way.
MODIFY
WalletWasabi/Models/ChaumianCoinJoin/CcjRound.cs
WalletWasabi/Models/ChaumianCoinJoin/CcjRound.cs
@@ -528,8 +528,7 @@ namespace WalletWasabi.Models.ChaumianCoinJoin
if (didNotConfirmeCount > 0)
{
// Adjust anonymity set.
- AnonymitySet = aliceCountAfterConnectionConfirmationTimeout;
- Logger.LogInfo<CcjRound>($"{didNotConfirmeCount} Alices did not confirm their connection. Anonymity set is lowered to {AnonymitySet}.");
+ UpdateAnonymitySet(aliceCountAfterConnectionConfirmationTimeout);
}
// Progress to the next phase, which will be OutputRegistration
await ExecuteNextPhaseAsync(CcjRoundPhase.OutputRegistration);
@@ -939,9 +938,9 @@ namespace WalletWasabi.Models.ChaumianCoinJoin
{
using (RoundSynchronizerLock.Lock())
{
- if ((Phase != CcjRoundPhase.InputRegistration) || Status != CcjRoundStatus.Running)
+ if ((Phase != CcjRoundPhase.InputRegistration && Phase != CcjRoundPhase.ConnectionConfirmation) || Status != CcjRoundStatus.Running)
{
- throw new InvalidOperationException($"Updating anonymity set is only allowed in {nameof(CcjRoundPhase.InputRegistration)} phase.");
+ throw new InvalidOperationException($"Updating anonymity set is not allowed in {Phase.ToString()} phase.");
}
AnonymitySet = anonymitySet;
}

Update anonymity set in a safer and more generic way.