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

Function commit_tx_amount_trimmed

channeld/commit_tx.c:39–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39bool commit_tx_amount_trimmed(const struct htlc **htlcs,
40 u32 feerate_per_kw,
41 struct amount_sat dust_limit,
42 bool option_anchor_outputs,
43 enum side side,
44 struct amount_msat *amt)
45{
46 for (size_t i = 0; i < tal_count(htlcs); i++) {
47 if (trim(htlcs[i], feerate_per_kw, dust_limit,
48 option_anchor_outputs, side))
49 if (!amount_msat_add(amt, *amt, htlcs[i]->amount))
50 return false;
51 }
52 return true;
53}
54
55static void add_offered_htlc_out(struct bitcoin_tx *tx, size_t n,
56 const struct htlc *htlc,

Callers 1

htlc_dustFunction · 0.85

Calls 2

trimFunction · 0.85
amount_msat_addFunction · 0.85

Tested by

no test coverage detected