make output values and iswasabi2cj as properties
MODIFY
WalletWasabi/Blockchain/Analysis/BlockchainAnalyzer.cs
WalletWasabi/Blockchain/Analysis/BlockchainAnalyzer.cs
@@ -125,14 +125,6 @@ public class BlockchainAnalyzer
.OrderByDescending(x => x)
.ToArray();
- var outputValues = tx.Transaction.Outputs.Select(x => x.Value.Satoshi).ToArray();
-
- bool isWasabi2Cj =
- tx.Transaction.Outputs.Count >= 2 // Sanity check.
- && tx.Transaction.Inputs.Count >= 50 // 50 was the minimum input count at the beginning of Wasabi 2.
- && outputValues.Count(x => StdDenoms.Contains(x)) > outputValues.Length * 0.8 // Most of the outputs contains the denomination.
- && outputValues.Zip(outputValues.Skip(1)).All(p => p.First >= p.Second); // Outputs are ordered descending.
-
var secondLargestOutputAmount = virtualOutputValues.Take(2).LastOrDefault();
if (secondLargestOutputAmount == default)
{
@@ -160,7 +152,7 @@ public class BlockchainAnalyzer
if (anonset < 1)
{
// When WW2 denom output isn't too large, then it's not change.
- if (isWasabi2Cj is true && StdDenoms.Contains(virtualOutput.Amount.Satoshi) && virtualOutput.Amount < secondLargestOutputAmount)
+ if (tx.IsWasabi2Cj is true && StdDenoms.Contains(virtualOutput.Amount.Satoshi) && virtualOutput.Amount < secondLargestOutputAmount)
{
startingOutputAnonset = startingMixedOutputAnonset;
}

MODIFY
WalletWasabi/Blockchain/Transactions/SmartTransaction.cs
WalletWasabi/Blockchain/Transactions/SmartTransaction.cs
@@ -3,6 +3,7 @@ using Newtonsoft.Json;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
+using WalletWasabi.Blockchain.Analysis;
using WalletWasabi.Blockchain.Analysis.Clustering;
using WalletWasabi.Blockchain.TransactionOutputs;
using WalletWasabi.Extensions;
@@ -37,6 +38,12 @@ public class SmartTransaction : IEquatable<SmartTransaction>
WalletInputsInternal = new HashSet<SmartCoin>(Transaction.Inputs.Count);
WalletOutputsInternal = new HashSet<SmartCoin>(Transaction.Outputs.Count);
+
+ OutputValues = Transaction.Outputs.Select(x => x.Value.Satoshi).ToArray();
+ IsWasabi2Cj = Transaction.Outputs.Count >= 2 // Sanity check.
+ && Transaction.Inputs.Count >= 50 // 50 was the minimum input count at the beginning of Wasabi 2.
+ && OutputValues.Count(x => BlockchainAnalyzer.StdDenoms.Contains(x)) > OutputValues.Length * 0.8 // Most of the outputs contains the denomination.
+ && OutputValues.Zip(OutputValues.Skip(1)).All(p => p.First >= p.Second); // Outputs are ordered descending.
}
#endregion Constructors
@@ -49,6 +56,9 @@ public class SmartTransaction : IEquatable<SmartTransaction>
/// <summary>Coins those are on the output side of the tx and belong to ANY loaded wallet. Later if more wallets are loaded this list can increase.</summary>
private HashSet<SmartCoin> WalletOutputsInternal { get; }
+ public long[] OutputValues { get; }
+ public bool IsWasabi2Cj { get; }
+
/// <summary>Cached computation of <see cref="ForeignInputs"/> or <c>null</c> when re-computation is needed.</summary>
private HashSet<IndexedTxIn>? ForeignInputsCache { get; set; } = null;

make output values and iswasabi2cj as properties