MCPcopy Create free account
hub / github.com/ElementsProject/lightning / amount_tx_fee

Function amount_tx_fee

common/amount.c:698–707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

696}
697
698struct amount_sat amount_tx_fee(u32 fee_per_kw, size_t weight)
699{
700 struct amount_sat fee;
701
702 /* If this overflows, weight must be > 2^32, which is not a real tx */
703 assert(!mul_overflows_u64(fee_per_kw, weight));
704 fee.satoshis = (u64)fee_per_kw * weight / 1000;
705
706 return fee;
707}
708
709bool amount_feerate(u32 *feerate, struct amount_sat fee, size_t weight)
710{

Callers 15

commit_tx_base_feeFunction · 0.70
lease_rates_calc_feeFunction · 0.70
htlc_timeout_feeFunction · 0.70
htlc_success_feeFunction · 0.70
calc_fee_boundsFunction · 0.50
trim_maximum_feerateFunction · 0.50
grind_htlc_tx_feeFunction · 0.50
change_feeFunction · 0.50
inputs_sufficientFunction · 0.50
finish_psbtFunction · 0.50
json_fundpsbtFunction · 0.50
json_addpsbtinputFunction · 0.50

Calls 1

mul_overflows_u64Function · 0.85

Tested by

no test coverage detected