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

Function try_subtract_fee

common/initial_commit_tx.c:31–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

commit_txFunction · 0.85
initial_commit_txFunction · 0.85

Calls 1

amount_msat_deduct_satFunction · 0.85

Tested by

no test coverage detected