Use virtual inputs
MODIFY
WalletWasabi/Blockchain/Analysis/BlockchainAnalyzer.cs
WalletWasabi/Blockchain/Analysis/BlockchainAnalyzer.cs
@@ -67,9 +67,9 @@ public class BlockchainAnalyzer
// Consolidation in coinjoins is the only type of consolidation that's acceptable,
// because coinjoins are an exception from common input ownership heuristic.
// Calculate weighted average.
- mixedAnonScore = tx.WalletInputs.Sum(x => x.HdPubKey.AnonymitySet * x.Amount.Satoshi) / tx.WalletInputs.Sum(x => x.Amount);
+ mixedAnonScore = tx.WalletVirtualInputs.Sum(x => x.HdPubKey.AnonymitySet * x.Amount.Satoshi) / tx.WalletVirtualInputs.Sum(x => x.Amount);
- nonMixedAnonScore = tx.WalletInputs.Min(x => x.HdPubKey.AnonymitySet);
+ nonMixedAnonScore = tx.WalletVirtualInputs.Min(x => x.HdPubKey.AnonymitySet);
}
private double AnalyzeSelfSpendWalletInputs(SmartTransaction tx)

MODIFY
WalletWasabi/Blockchain/TransactionOutputs/WalletVirtualInput.cs
WalletWasabi/Blockchain/TransactionOutputs/WalletVirtualInput.cs
@@ -15,9 +15,11 @@ public class WalletVirtualInput
Id = id;
Coins = coins;
HdPubKey = coins.Select(x => x.HdPubKey).Distinct().Single();
+ Amount = coins.Sum(x => x.Amount);
}
public byte[] Id { get; }
public ISet<SmartCoin> Coins { get; }
public HdPubKey HdPubKey { get; }
+ public Money Amount { get; }
}

Use virtual inputs