Make sure mixi s triggered when coin added to the waitinglist
MODIFY
WalletWasabi.Tests/RegTests.cs
WalletWasabi.Tests/RegTests.cs
@@ -2281,7 +2281,7 @@ namespace WalletWasabi.Tests
try
{
chaumianClient1.Start();
- //chaumianClient2.Start();
+ chaumianClient2.Start();
smartCoin1.Locked = true;
Assert.True(0 == chaumianClient1.QueueCoinsToMix(password, smartCoin1).Count());
@@ -2316,17 +2316,17 @@ namespace WalletWasabi.Tests
Assert.True(2 == chaumianClient1.QueueCoinsToMix(password, smartCoin1, smartCoin2).Count());
Assert.True(smartCoin1.Locked);
Assert.True(smartCoin2.Locked);
- //Assert.True(1 == chaumianClient2.QueueCoinsToMix(password, smartCoin3).Count());
-
- //Task timeout = Task.Delay(TimeSpan.FromSeconds(connectionConfirmationTimeout * 2 + 7 * 2 + 7 * 2 + 7 * 2));
- //while ((await rpc.GetRawMempoolAsync()).Length == 0)
- //{
- // if(timeout.IsCompletedSuccessfully)
- // {
- // throw new TimeoutException("CoinJoin wasn't propagated.");
- // }
- // await Task.Delay(1000);
- //}
+ Assert.True(1 == chaumianClient2.QueueCoinsToMix(password, smartCoin3).Count());
+
+ Task timeout = Task.Delay(TimeSpan.FromSeconds(connectionConfirmationTimeout * 2 + 7 * 2 + 7 * 2 + 7 * 2));
+ while ((await rpc.GetRawMempoolAsync()).Length == 0)
+ {
+ if (timeout.IsCompletedSuccessfully)
+ {
+ throw new TimeoutException("CoinJoin wasn't propagated.");
+ }
+ await Task.Delay(1000);
+ }
}
finally
{

MODIFY
WalletWasabi/Models/ChaumianCoinJoin/CcjClientState.cs
WalletWasabi/Models/ChaumianCoinJoin/CcjClientState.cs
@@ -69,6 +69,14 @@ namespace WalletWasabi.Models.ChaumianCoinJoin
}
}
+ public int GetWaitingListCount()
+ {
+ lock (StateLock)
+ {
+ return WaitingList.Count;
+ }
+ }
+
public SmartCoin GetSingleOrDefaultFromWaitingList((uint256 txid, int index) coinReference)
{
lock (StateLock)

MODIFY
WalletWasabi/Services/CcjClient.cs
WalletWasabi/Services/CcjClient.cs
@@ -97,7 +97,7 @@ namespace WalletWasabi.Services
{
delay = new Random().Next(2, 7);
}
- else if (Interlocked.Read(ref _frequentStatusProcessingIfNotMixing) == 1 || State.GetPassivelyMixingRounds().Count() > 0)
+ else if (Interlocked.Read(ref _frequentStatusProcessingIfNotMixing) == 1 || State.GetPassivelyMixingRounds().Count() > 0 || State.GetWaitingListCount() > 0)
{
double rand = double.Parse($"0.{new Random().Next(2, 8)}"); // randomly between every 0.2 * connConfTimeout - 7 and 0.8 * connConfTimeout
delay = Math.Max(0, (int)(rand * State.GetSmallestRegistrationTimeout() - 7));

Make sure mixi s triggered when coin added to the waitinglist