Add dust check
MODIFY
HiddenWallet.ChaumianTumbler/Controllers/TumblerController.cs
HiddenWallet.ChaumianTumbler/Controllers/TumblerController.cs
@@ -197,9 +197,9 @@ namespace HiddenWallet.ChaumianTumbler.Controllers
}
Money feeToPay = (inputs.Count() * Global.StateMachine.FeePerInputs + 2 * Global.StateMachine.FeePerOutputs);
Money changeAmount = amount - (Global.StateMachine.Denomination + feeToPay);
- if (changeAmount < Money.Zero)
+ if (changeAmount < Money.Zero + new Money(548)) // 546 is dust
{
- throw new ArgumentException("Total provided inputs must be > denomination + fee");
+ throw new ArgumentException("Total provided inputs must be > denomination + fee + dust");
}
byte[] signature = Global.RsaKey.SignBlindedData(blindedOutput);

MODIFY
HiddenWallet.FullSpvWallet/ChaumianCoinJoin/CoinJoinService.cs
HiddenWallet.FullSpvWallet/ChaumianCoinJoin/CoinJoinService.cs
@@ -287,7 +287,7 @@ namespace HiddenWallet.FullSpvWallet.ChaumianCoinJoin
throw new NotSupportedException($"The fee required by the coordinator is too high: {fee.ToString(false, true)} BTC");
}
- Money needed = Denomination + fee;
+ Money needed = Denomination + fee + new Money(549); // 546 satoshi is dust
Inputs.Add(coin);
var input = coin.Outpoint.ToHex();

Add dust check