Don't start CJ with only private coins
MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinManager.cs
WalletWasabi/WabiSabi/Client/CoinJoinManager.cs
@@ -10,6 +10,7 @@ using System.Threading.Tasks;
using WalletWasabi.Blockchain.Keys;
using WalletWasabi.Blockchain.TransactionOutputs;
using WalletWasabi.Extensions;
+using WalletWasabi.Helpers;
using WalletWasabi.Logging;
using WalletWasabi.WabiSabi.Client.CoinJoinProgressEvents;
using WalletWasabi.WabiSabi.Client.RoundStateAwaiters;
@@ -183,6 +184,7 @@ public class CoinJoinManager : BackgroundService
return;
}
+ // If all coins are already private, then don't mix.
if (await walletToStart.IsWalletPrivateAsync().ConfigureAwait(false))
{
walletToStart.LogTrace("All mixed!");
@@ -196,7 +198,8 @@ public class CoinJoinManager : BackgroundService
}
var coinCandidates = (await SelectCandidateCoinsAsync(walletToStart, synchronizerResponse.BestHeight).ConfigureAwait(false)).ToArray();
- if (coinCandidates.Length == 0)
+ if (coinCandidates.Length == 0 ||
+ coinCandidates.All(x => x.IsPrivate(walletToStart.AnonScoreTarget))) // If all selectable coins are already private, then don't mix.
{
walletToStart.LogDebug("No candidate coins available to mix.");
ScheduleRestartAutomatically(walletToStart, trackedAutoStarts, startCommand.StopWhenAllMixed, startCommand.OverridePlebStop, stoppingToken);

Don't start CJ with only private coins