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

Function calc_feerate

wallet/wallet.c:627–641  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

625}
626
627static u32 calc_feerate(struct amount_sat excess_sats,
628 struct amount_sat output_sats_required,
629 size_t weight)
630{
631 struct amount_sat fee;
632 u32 feerate;
633
634 if (!amount_sat_sub(&fee, excess_sats, output_sats_required))
635 return 0;
636 /* A legal wallet amount can imply more than UINT32_MAX sat/kw on a
637 * small tx. That is above every representable feerate_target. */
638 if (!amount_feerate(&feerate, fee, weight))
639 return UINT32_MAX;
640 return feerate;
641}
642
643/* Gather enough utxos to meet feerate, otherwise all we can. */
644struct utxo **wallet_utxo_boost(const tal_t *ctx,

Callers 1

wallet_utxo_boostFunction · 0.85

Calls 2

amount_sat_subFunction · 0.50
amount_feerateFunction · 0.50

Tested by

no test coverage detected