Calculate fee amount from fee rate if available

This commit is contained in:
OmarHatem 2022-12-16 19:21:40 +02:00
parent afd9fe7554
commit 7ffb654065

View file

@ -191,8 +191,10 @@ abstract class ElectrumWalletBase extends WalletBase<ElectrumBalance,
throw BitcoinTransactionNoInputsException();
}
final allAmountFee = feeAmountForPriority(
transactionCredentials.priority!, inputs.length, outputs.length);
final allAmountFee = transactionCredentials.feeRate != null
? feeAmountWithFeeRate(transactionCredentials.feeRate!, inputs.length, outputs.length)
: feeAmountForPriority(transactionCredentials.priority!, inputs.length, outputs.length);
final allAmount = allInputsAmount - allAmountFee;
var credentialsAmount = 0;