| 410 | }; |
| 411 | |
| 412 | static 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 | |
| 438 | static void adjust_feerange(struct feerange *feerange, |
| 439 | struct amount_sat offer, enum side side) |
no test coverage detected