Remove CustomFeeRate property
MODIFY
WalletWasabi.Fluent/Helpers/TransactionHelpers.cs
WalletWasabi.Fluent/Helpers/TransactionHelpers.cs
@@ -54,7 +54,7 @@ namespace WalletWasabi.Fluent.Helpers
transactionInfo.Address,
transactionInfo.Amount,
transactionInfo.UserLabels,
- transactionInfo.IsCustomFeeUsed ? transactionInfo.CustomFeeRate : transactionInfo.FeeRate,
+ transactionInfo.FeeRate,
transactionInfo.Coins,
transactionInfo.SubtractFee,
isPayJoin ? transactionInfo.PayJoinClient : null);

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/AdvancedSendOptionsViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/AdvancedSendOptionsViewModel.cs
@@ -21,8 +21,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
{
_transactionInfo = transactionInfo;
- _customFee = transactionInfo.CustomFeeRate != FeeRate.Zero
- ? transactionInfo.CustomFeeRate.SatoshiPerByte.ToString(CultureInfo.InvariantCulture)
+ _customFee = transactionInfo.IsCustomFeeUsed
+ ? transactionInfo.FeeRate.SatoshiPerByte.ToString(CultureInfo.InvariantCulture)
: "";
EnableBack = false;
@@ -45,10 +45,16 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
private void OnNext()
{
- _transactionInfo.CustomFeeRate =
- decimal.TryParse(CustomFee, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out var customFee)
- ? new FeeRate(customFee)
- : FeeRate.Zero;
+ if (decimal.TryParse(CustomFee, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out var feeRate))
+ {
+ _transactionInfo.FeeRate = new FeeRate(feeRate);
+ _transactionInfo.IsCustomFeeUsed = true;
+ }
+ else
+ {
+ _transactionInfo.FeeRate = FeeRate.Zero;
+ _transactionInfo.IsCustomFeeUsed = false;
+ }
Close(DialogResultKind.Normal, Unit.Default);
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/OptimisePrivacyViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/OptimisePrivacyViewModel.cs
@@ -81,7 +81,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
var smallerTransaction = await Task.Run(() => _wallet.BuildTransaction(
_wallet.Kitchen.SaltSoup(),
intent,
- FeeStrategy.CreateFromFeeRate(_transactionInfo.IsCustomFeeUsed ? _transactionInfo.CustomFeeRate : _transactionInfo.FeeRate),
+ FeeStrategy.CreateFromFeeRate(_transactionInfo.FeeRate),
allowUnconfirmed: true,
_requestedTransaction
.SpentCoins
@@ -101,7 +101,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
var largerTransaction = await Task.Run(() => _wallet.BuildTransaction(
_wallet.Kitchen.SaltSoup(),
intent,
- FeeStrategy.CreateFromFeeRate(_transactionInfo.IsCustomFeeUsed ? _transactionInfo.CustomFeeRate : _transactionInfo.FeeRate),
+ FeeStrategy.CreateFromFeeRate(_transactionInfo.FeeRate),
true,
_requestedTransaction.SpentCoins.Select(x => x.OutPoint)));

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionInfo.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionInfo.cs
@@ -30,8 +30,6 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
public FeeRate FeeRate { get; set; } = FeeRate.Zero;
- public FeeRate CustomFeeRate { get; set; } = FeeRate.Zero;
-
public TimeSpan ConfirmationTimeSpan { get; set; }
public IEnumerable<SmartCoin> Coins { get; set; } = Enumerable.Empty<SmartCoin>();
@@ -42,14 +40,18 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
public bool IsPrivatePocketUsed => Coins.All(x => x.HdPubKey.AnonymitySet >= _privateCoinThreshold);
- public bool IsCustomFeeUsed => CustomFeeRate != FeeRate.Zero;
+ public bool IsCustomFeeUsed { get; set; }
public bool SubtractFee { get; set; }
private void OnAmountChanged()
{
SubtractFee = default;
+
+ if (!IsCustomFeeUsed)
+ {
FeeRate = FeeRate.Zero;
+ }
if (Coins.Sum(x => x.Amount) < Amount) // Reset coins if the selected cluster is not enough for the new amount
{

Remove CustomFeeRate property