Fix anonset calculation for arriving and change coins
MODIFY
WalletWasabi/Services/WalletService.cs
WalletWasabi/Services/WalletService.cs
@@ -529,7 +529,7 @@ namespace WalletWasabi.Services
var anonset = tx.Transaction.GetAnonymitySet(i);
if (spentOwnCoins.Count != 0)
{
- anonset += spentOwnCoins.Min(x => x.AnonymitySet);
+ anonset += spentOwnCoins.Min(x => x.AnonymitySet) - 1; // Minus 1, because don't count own.
// Cleanup exposed links where the txo has been spent.
foreach (var input in spentOwnCoins.Select(x => x.GetTxoRef()))
@@ -1150,7 +1150,7 @@ namespace WalletWasabi.Services
for (var i = 0U; i < tx.Outputs.Count; i++)
{
TxOut output = tx.Outputs[i];
- var anonset = tx.GetAnonymitySet(i) + spentCoins.Min(x => x.AnonymitySet);
+ var anonset = (tx.GetAnonymitySet(i) + spentCoins.Min(x => x.AnonymitySet)) - 1; // Minus 1, because count own only once.
var foundKey = KeyManager.GetKeys(KeyState.Clean).FirstOrDefault(x => output.ScriptPubKey == x.P2wpkhScript);
var coin = new SmartCoin(tx.GetHash(), i, output.ScriptPubKey, output.Value, tx.Inputs.ToTxoRefs().ToArray(), Height.Unknown, tx.RBF, anonset, pubKey: foundKey);

Fix anonset calculation for arriving and change coins