Fix utxo banning bug
MODIFY
WalletWasabi.Tests/RegTests.cs
WalletWasabi.Tests/RegTests.cs
@@ -2232,8 +2232,14 @@ namespace WalletWasabi.Tests
using (var satoshiClient = new SatoshiClient(baseUri))
{
IEnumerable<CcjRunningRoundState> states = await satoshiClient.GetAllRoundStatesAsync();
+ foreach (CcjRoundPhase phase in states.Select(x => x.Phase))
+ {
+ Assert.Equal(CcjRoundPhase.InputRegistration, phase);
+ }
}
+ Assert.True(coordinator.UtxoReferee.BannedUtxos.Count >= roundConfig.AnonymitySet);
+
foreach (var aliceClient in aliceClients)
{
aliceClient.Dispose();

MODIFY
WalletWasabi/Models/ChaumianCoinJoin/CcjRound.cs
WalletWasabi/Models/ChaumianCoinJoin/CcjRound.cs
@@ -433,13 +433,20 @@ namespace WalletWasabi.Models.ChaumianCoinJoin
case CcjRoundPhase.Signing:
{
- // ?: Am I not banning non-signing alices?
- // ?: It doesn't progress forward RemoveAlicesIfInputsSpentAsync
-
- IEnumerable<Alice> alicesToBan = await RemoveAlicesIfInputsSpentAsync();
- if (alicesToBan.Any())
+ var outpointsToBan = new List<OutPoint>();
+ using (await RoundSyncronizerLock.LockAsync())
+ {
+ foreach (Alice alice in Alices)
+ {
+ if (alice.State != AliceState.SignedCoinJoin)
+ {
+ outpointsToBan.AddRange(alice.Inputs.Select(x => x.OutPoint));
+ }
+ }
+ }
+ if (outpointsToBan.Any())
{
- await UtxoReferee.BanUtxosAsync(1, DateTimeOffset.UtcNow, alicesToBan.SelectMany(x => x.Inputs).Select(y => y.OutPoint).ToArray());
+ await UtxoReferee.BanUtxosAsync(1, DateTimeOffset.UtcNow, outpointsToBan.ToArray());
}
Fail();
}

Fix utxo banning bug