Merge rust-bitcoin/rust-bitcoin#3903: refactor: use convenience method to calculate fee

ee0486a43f refactor: use convenience method to calculate fee (yancy)

Pull request description:

  The FeeRate module provides a convenience method to calculate the fee.

ACKs for top commit:
  tcharding:
    ACK ee0486a43f
  apoelstra:
    ACK ee0486a43f33a6068f13fb1a82244ecb60b94740; successfully ran local tests

Tree-SHA512: 076750b8733d2988ba482096a1903f1cae01b6055743fba8176a61d15159273fffc79007a01b212c9ad2c3835cdbbc17157da48ea7dd58113a5398eaad6e7c37
This commit is contained in:
merge-script 2025-02-09 17:53:12 +00:00
commit 0d76669418
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
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)
}