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

Function init_feerange

closingd/closingd.c:412–436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410};
411
412static void init_feerange(struct feerange *feerange,
413 struct amount_sat commitment_fee,
414 const struct amount_sat offer[NUM_SIDES])
415{
416 feerange->min = AMOUNT_SAT(0);
417
418 /* FIXME: BOLT 2 previously said that we have to set it to less than
419 * the final commit fee: we do this for now, still:
420 *
421 * - MUST set `fee_satoshis` less than or equal to the base
422 * fee of the final commitment transaction, as calculated
423 * in [BOLT #3](03-transactions.md#fee-calculation).
424 */
425 feerange->max = commitment_fee;
426
427 if (amount_sat_greater(offer[LOCAL], offer[REMOTE]))
428 feerange->higher_side = LOCAL;
429 else
430 feerange->higher_side = REMOTE;
431
432 status_debug("Feerange init %s-%s, %s higher",
433 fmt_amount_sat(tmpctx, feerange->min),
434 fmt_amount_sat(tmpctx, feerange->max),
435 feerange->higher_side == LOCAL ? "local" : "remote");
436}
437
438static void adjust_feerange(struct feerange *feerange,
439 struct amount_sat offer, enum side side)

Callers 1

mainFunction · 0.85

Calls 2

amount_sat_greaterFunction · 0.85
fmt_amount_satFunction · 0.50

Tested by

no test coverage detected