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: ACKee0486a43f
apoelstra: ACK ee0486a43f33a6068f13fb1a82244ecb60b94740; successfully ran local tests Tree-SHA512: 076750b8733d2988ba482096a1903f1cae01b6055743fba8176a61d15159273fffc79007a01b212c9ad2c3835cdbbc17157da48ea7dd58113a5398eaad6e7c37
This commit is contained in:
commit
0d76669418
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue