fix custom rate issue (#1579)

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
Serhii
2024-08-10 00:49:27 +03:00
committed by GitHub
co-authored by Omar Hatem
parent 14e99daa73
commit acadee6ed5
5 changed files with 19 additions and 6 deletions
@@ -378,9 +378,9 @@ abstract class TransactionDetailsViewModelBase with Store {
sendViewModel.displayFeeRate(priority, sliderValue.round()),
onSliderChanged: (double newValue) =>
setNewFee(value: newValue, priority: transactionPriority!),
onItemSelected: (dynamic item) {
onItemSelected: (dynamic item, double sliderValue) {
transactionPriority = item as TransactionPriority;
return setNewFee(priority: transactionPriority!);
return setNewFee(value: sliderValue, priority: transactionPriority!);
}));
if (transactionInfo.inputAddresses != null) {
@@ -427,7 +427,11 @@ abstract class TransactionDetailsViewModelBase with Store {
String setNewFee({double? value, required TransactionPriority priority}) {
newFee = priority == bitcoin!.getBitcoinTransactionPriorityCustom() && value != null
? bitcoin!.getEstimatedFeeWithFeeRate(wallet, value.round(), transactionInfo.amount)
? bitcoin!.feeAmountWithFeeRate(
wallet,
value.round(),
transactionInfo.inputAddresses?.length ?? 1,
transactionInfo.outputAddresses?.length ?? 1)
: bitcoin!.getFeeAmountForPriority(
wallet,
priority,