fix blinded output count check bug
MODIFY
WalletWasabi.Backend/Controllers/ChaumianCoinJoinController.cs
WalletWasabi.Backend/Controllers/ChaumianCoinJoinController.cs
@@ -536,7 +536,7 @@ namespace WalletWasabi.Backend.Controllers
return BadRequest($"Invalid outputAddress is provided. Details: {ex.Message}");
}
- if (round.CountBobs() == round.BlindSignatureCount)
+ if (round.CountBobs() == round.CountBlindSignatures()) // If there'll be more bobs, then round failed. Someone may broke the crypto.
{
await round.ExecuteNextPhaseAsync(CcjRoundPhase.Signing);
}

MODIFY
WalletWasabi/Models/ChaumianCoinJoin/CcjRound.cs
WalletWasabi/Models/ChaumianCoinJoin/CcjRound.cs
@@ -27,8 +27,6 @@ namespace WalletWasabi.Models.ChaumianCoinJoin
public decimal CoordinatorFeePercent { get; }
public int AnonymitySet { get; private set; }
- public int BlindSignatureCount { get; private set; }
-
public Money FeePerInputs { get; private set; }
public Money FeePerOutputs { get; private set; }
@@ -227,8 +225,6 @@ namespace WalletWasabi.Models.ChaumianCoinJoin
return;
}
- BlindSignatureCount = Alices.Sum(x => x.BlindedOutputScripts.Length);
-
Phase = CcjRoundPhase.ConnectionConfirmation;
}
else if (Phase == CcjRoundPhase.ConnectionConfirmation)
@@ -743,6 +739,14 @@ namespace WalletWasabi.Models.ChaumianCoinJoin
}
}
+ public int CountBlindSignatures()
+ {
+ using (RoundSynchronizerLock.Lock())
+ {
+ return Alices.Sum(x => x.BlindedOutputScripts.Length);
+ }
+ }
+
public bool ContainsBlindedOutputScript(uint256 blindedOutputScript)
{
using (RoundSynchronizerLock.Lock())

fix blinded output count check bug