fix off by one bug, make sure with the "max" button we cannot accidentally send more.
MODIFY
WalletWasabi/Models/TransactionBuilding/FeeStrategy.cs
WalletWasabi/Models/TransactionBuilding/FeeStrategy.cs
@@ -43,7 +43,7 @@ namespace WalletWasabi.Models.TransactionBuilding
public static FeeStrategy CreateFromConfirmationTarget(int confirmationTarget) => new FeeStrategy(FeeStrategyType.Target, confirmationTarget: confirmationTarget, feeRate: null);
- public static FeeStrategy CreateFromFeeRate(FeeRate feeRate) => new FeeStrategy(FeeStrategyType.Target, confirmationTarget: null, feeRate: feeRate);
+ public static FeeStrategy CreateFromFeeRate(FeeRate feeRate) => new FeeStrategy(FeeStrategyType.Rate, confirmationTarget: null, feeRate: feeRate);
private FeeStrategy(FeeStrategyType type, int? confirmationTarget, FeeRate feeRate)
{

MODIFY
WalletWasabi/Services/WalletService.cs
WalletWasabi/Services/WalletService.cs
@@ -901,6 +901,9 @@ namespace WalletWasabi.Services
: Coins.Where(x => !x.Unavailable && x.Confirmed && allowedInputs.Any(y => y.TransactionId == x.TransactionId && y.Index == x.Index)).ToList();
// Add those that have the same script, because common ownership is already exposed.
+ // But only if the user didn't click the "max" button. In this case he'd send more money than what he'd think.
+ if (payments.ChangeStrategy != ChangeStrategy.AllRemainingCustom)
+ {
var allScripts = allowedSmartCoinInputs.Select(x => x.ScriptPubKey).ToHashSet();
foreach (var coin in Coins.Where(x => !x.Unavailable && !allowedSmartCoinInputs.Any(y => x.TransactionId == y.TransactionId && x.Index == y.Index)))
{
@@ -915,6 +918,7 @@ namespace WalletWasabi.Services
}
}
}
+ }
else
{
allowedSmartCoinInputs = allowUnconfirmed ? Coins.Where(x => !x.Unavailable).ToList() : Coins.Where(x => !x.Unavailable && x.Confirmed).ToList();

fix off by one bug, make sure with the "max" button we cannot accidentally send more.