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

Function within_fee

common/amount.c:643–654  ·  view source on GitHub ↗

Does this input give enough to provide fee for output? */

Source from the content-addressed store, hash-verified

641
642/* Does this input give enough to provide fee for output? */
643static bool within_fee(struct amount_msat in,
644 struct amount_msat out,
645 u32 fee_base_msat,
646 u32 fee_proportional_millionths)
647{
648 struct amount_msat with_fee = out;
649 if (!amount_msat_add_fee(&with_fee,
650 fee_base_msat,
651 fee_proportional_millionths))
652 return false;
653 return amount_msat_less_eq(with_fee, in);
654}
655
656struct amount_msat amount_msat_sub_fee(struct amount_msat in,
657 u32 fee_base_msat,

Callers 1

amount_msat_sub_feeFunction · 0.85

Calls 2

amount_msat_add_feeFunction · 0.85
amount_msat_less_eqFunction · 0.85

Tested by

no test coverage detected