Make sanction negative
MODIFY
WalletWasabi/Blockchain/Analysis/BlockchainAnalyzer.cs
WalletWasabi/Blockchain/Analysis/BlockchainAnalyzer.cs
@@ -70,10 +70,10 @@ public class BlockchainAnalyzer
// because coinjoins are an exception from common input ownership heuristic.
// Calculate weighted average.
mixedAnonScore = tx.WalletVirtualInputs.Sum(x => (x.HdPubKey.AnonymitySet * x.Amount.Satoshi) / tx.WalletVirtualInputs.Sum(x => x.Amount));
- mixedAnonScoreSanctioned = tx.WalletVirtualInputs.Sum(x => (x.HdPubKey.AnonymitySet - cjAnal.ComputeInputSanction(x)) * x.Amount.Satoshi) / tx.WalletVirtualInputs.Sum(x => x.Amount);
+ mixedAnonScoreSanctioned = tx.WalletVirtualInputs.Sum(x => (x.HdPubKey.AnonymitySet + cjAnal.ComputeInputSanction(x)) * x.Amount.Satoshi) / tx.WalletVirtualInputs.Sum(x => x.Amount);
nonMixedAnonScore = tx.WalletVirtualInputs.Min(x => x.HdPubKey.AnonymitySet);
- nonMixedAnonScoreSanctioned = tx.WalletVirtualInputs.Min(x => x.HdPubKey.AnonymitySet - cjAnal.ComputeInputSanction(x));
+ nonMixedAnonScoreSanctioned = tx.WalletVirtualInputs.Min(x => x.HdPubKey.AnonymitySet + cjAnal.ComputeInputSanction(x));
}
private double AnalyzeSelfSpendWalletInputs(SmartTransaction tx)

MODIFY
WalletWasabi/Blockchain/Analysis/CoinjoinAnalyzer.cs
WalletWasabi/Blockchain/Analysis/CoinjoinAnalyzer.cs
@@ -43,7 +43,7 @@ public class CoinjoinAnalyzer
// We are searching for any transaction inputs of analyzedTransaction that might have come from this transaction.
// If we find such remixed outputs, then we determine how much they contributed to our anonymity set.
SmartTransaction transaction = transactionOutput.Transaction;
- double sanction = ComputeAnonymityContribution(transactionOutput, AnalyzedTransactionPrevOuts);
+ double sanction = -ComputeAnonymityContribution(transactionOutput, AnalyzedTransactionPrevOuts);
// Recursively branch out into all of the transaction inputs' histories and compute the sanction for each branch.
// Add the worst-case branch to the resulting sanction.

Make sanction negative