Move condition check from IsAvailable
MODIFY
WalletWasabi/Blockchain/TransactionOutputs/SmartCoin.cs
WalletWasabi/Blockchain/TransactionOutputs/SmartCoin.cs
@@ -173,9 +173,9 @@ public class SmartCoin : NotifyPropertyChangedBase, IEquatable<SmartCoin>, IDest
public bool IsSpent() => SpenderTransaction is not null;
/// <summary>
- /// IsUnspent() AND !SpentAccordingToBackend AND !CoinJoinInProgress AND !IsExcludedFromCoinJoin
+ /// IsUnspent() AND !SpentAccordingToBackend AND !CoinJoinInProgress
/// </summary>
- public bool IsAvailable() => SpenderTransaction is null && !SpentAccordingToBackend && !CoinJoinInProgress && !IsExcludedFromCoinJoin;
+ public bool IsAvailable() => SpenderTransaction is null && !SpentAccordingToBackend && !CoinJoinInProgress;
public bool IsReplaceable() => Transaction.IsRBF;

MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinManager.cs
WalletWasabi/WabiSabi/Client/CoinJoinManager.cs
@@ -504,9 +504,10 @@ public class CoinJoinManager : BackgroundService
=> new CoinsView(await openedWallet.GetCoinjoinCoinCandidatesAsync().ConfigureAwait(false))
.Available()
.Confirmed()
- .Where(x => !x.IsImmature(bestHeight))
- .Where(x => !x.IsBanned)
- .Where(x => !CoinRefrigerator.IsFrozen(x));
+ .Where(coin => !coin.IsExcludedFromCoinJoin)
+ .Where(coin => !coin.IsImmature(bestHeight))
+ .Where(coin => !coin.IsBanned)
+ .Where(coin => !CoinRefrigerator.IsFrozen(coin));
private static async Task WaitAndHandleResultOfTasksAsync(string logPrefix, params Task[] tasks)
{

Move condition check from IsAvailable