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

Function try_subtract_fee

common/initial_commit_tx.c:32–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32bool try_subtract_fee(enum side opener, enum side side,
33 struct amount_sat base_fee,
34 struct amount_msat *self,
35 struct amount_msat *other)
36{
37 struct amount_msat *opener_amount;
38
39 if (opener == side)
40 opener_amount = self;
41 else
42 opener_amount = other;
43
44 if (amount_msat_sub_sat(opener_amount, *opener_amount, base_fee))
45 return true;
46
47 *opener_amount = AMOUNT_MSAT(0);
48 return false;
49}
50
51u8 *to_self_wscript(const tal_t *ctx,
52 u16 to_self_delay,

Callers 2

commit_txFunction · 0.85
initial_commit_txFunction · 0.85

Calls 1

amount_msat_sub_satFunction · 0.85

Tested by

no test coverage detected