a few correction
MODIFY
WalletWasabi.Fluent/Helpers/TransactionFeeHelper.cs
WalletWasabi.Fluent/Helpers/TransactionFeeHelper.cs
@@ -41,5 +41,12 @@ namespace WalletWasabi.Fluent.Helpers
return first.Value == last.Value;
}
+
+ public static TimeSpan CalculateConfirmationTime(double targetBlock)
+ {
+ var timeInMinutes = Math.Ceiling(targetBlock) * 10;
+ var time = TimeSpan.FromMinutes(timeInMinutes);
+ return time;
+ }
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendFeeViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendFeeViewModel.cs
@@ -41,7 +41,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
NextCommand = ReactiveCommand.Create(() =>
{
- _transactionInfo.ConfirmationTimeSpan = CalculateConfirmationTime(FeeChart.CurrentConfirmationTarget);
+ _transactionInfo.ConfirmationTimeSpan = TransactionFeeHelper.CalculateConfirmationTime(FeeChart.CurrentConfirmationTarget);
Complete();
});
@@ -95,7 +95,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
var blockTarget = GetBestBlockTarget(estimations, satPerByteThreshold, blockTargetThreshold);
FeeChart.CurrentConfirmationTarget = blockTarget;
- _transactionInfo.ConfirmationTimeSpan = CalculateConfirmationTime(blockTarget);
+ _transactionInfo.ConfirmationTimeSpan = TransactionFeeHelper.CalculateConfirmationTime(blockTarget);
Complete();
}
@@ -118,12 +118,5 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
return blockTargetThreshold;
}
-
- public static TimeSpan CalculateConfirmationTime(double targetBlock)
- {
- var timeInMinutes = Math.Ceiling(targetBlock) * 10;
- var time = TimeSpan.FromMinutes(timeInMinutes);
- return time;
- }
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionInfo.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionInfo.cs
@@ -48,7 +48,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
{
SubtractFee = default;
FeeRate = FeeRate.Zero;
- MaximumPossibleFeeRate = FeeRate.Zero;
+ MaximumPossibleFeeRate = null;
if (Coins.Sum(x => x.Amount) < Amount) // Reset coins if the selected cluster is not enough for the new amount
{

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
@@ -192,7 +192,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
if (!result)
{
- await ShowErrorAsync("Transaction Building", "Due to the high transaction fees, it is not possible to send this transaction at the moment.",
+ await ShowErrorAsync("Transaction Building", "At the moment, it is not possible to select a transaction fee that is less than the payment amount. The transaction cannot be sent.",
"Wasabi was unable to create your transaction.");
return null;
@@ -228,21 +228,23 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
{
var currentFeeRate = transactionInfo.FeeRate;
var maxPossibleFeeRateInSatoshiPerByte = (currentFeeRate.SatoshiPerByte / percentageOfOverpayment) * 100;
- transactionInfo.MaximumPossibleFeeRate = new FeeRate(maxPossibleFeeRateInSatoshiPerByte);
+ var maximumPossibleFeeRate = new FeeRate(maxPossibleFeeRateInSatoshiPerByte);
var feeChartViewModel = new FeeChartViewModel();
- var feeEstimations = wallet.Network == Network.Main ? wallet.FeeProvider.AllFeeEstimate.Estimations : SendFeeViewModel.TestNetFeeEstimates;
- feeChartViewModel.UpdateFeeEstimates(feeEstimations);
+ feeChartViewModel.UpdateFeeEstimates(TransactionFeeHelper.GetFeeEstimates(wallet));
- var blockTarget = feeChartViewModel.GetConfirmationTarget(transactionInfo.MaximumPossibleFeeRate);
- transactionInfo.FeeRate = new FeeRate(feeChartViewModel.GetSatoshiPerByte(blockTarget));
+ var blockTarget = feeChartViewModel.GetConfirmationTarget(maximumPossibleFeeRate);
+ var newFeeRate = new FeeRate(feeChartViewModel.GetSatoshiPerByte(blockTarget));
- if (transactionInfo.FeeRate > transactionInfo.MaximumPossibleFeeRate)
+ if (newFeeRate > maximumPossibleFeeRate)
{
return false;
}
- transactionInfo.ConfirmationTimeSpan = SendFeeViewModel.CalculateConfirmationTime(blockTarget);
+ transactionInfo.ConfirmationTimeSpan = TransactionFeeHelper.CalculateConfirmationTime(blockTarget);
+ transactionInfo.FeeRate = newFeeRate;
+ transactionInfo.MaximumPossibleFeeRate = maximumPossibleFeeRate;
+
return true;
}

a few correction