refactor: use convenience method to calculate fee

The FeeRate module provides a convenience method to calculate the fee.
This commit is contained in:
yancy 2025-01-14 12:29:46 -06:00 committed by yancy
parent 16cf1f7f2a
commit ee0486a43f
1 changed files with 1 additions and 1 deletions

View File

@ -790,7 +790,7 @@ pub fn effective_value(
value: Amount,
) -> Option<SignedAmount> {
let weight = satisfaction_weight.checked_add(TX_IN_BASE_WEIGHT)?;
let signed_input_fee = fee_rate.checked_mul_by_weight(weight)?.to_signed();
let signed_input_fee = fee_rate.to_fee(weight)?.to_signed();
value.to_signed().checked_sub(signed_input_fee)
}