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

Function commit_tx_amount_trimmed

channeld/commit_tx.c:44–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44bool commit_tx_amount_trimmed(const struct htlc **htlcs,
45 u32 feerate_per_kw,
46 struct amount_sat dust_limit,
47 bool option_anchor_outputs,
48 bool option_anchors_zero_fee_htlc_tx,
49 enum side side,
50 struct amount_msat *amt)
51{
52 for (size_t i = 0; i < tal_count(htlcs); i++) {
53 if (trim(htlcs[i], feerate_per_kw, dust_limit,
54 option_anchor_outputs, option_anchors_zero_fee_htlc_tx,
55 side)) {
56 if (!amount_msat_accumulate(amt, htlcs[i]->amount))
57 return false;
58 }
59 }
60 return true;
61}
62
63static void add_offered_htlc_out(struct bitcoin_tx *tx, size_t n,
64 const struct htlc *htlc,

Callers 1

htlc_dustFunction · 0.85

Calls 2

trimFunction · 0.85
amount_msat_accumulateFunction · 0.85

Tested by

no test coverage detected