| 387 | }; |
| 388 | |
| 389 | static void init_feerange(struct feerange *feerange, |
| 390 | struct amount_sat commitment_fee, |
| 391 | const struct amount_sat offer[NUM_SIDES]) |
| 392 | { |
| 393 | feerange->min = AMOUNT_SAT(0); |
| 394 | |
| 395 | /* FIXME: BOLT 2 previously said that we have to set it to less than |
| 396 | * the final commit fee: we do this for now, still: |
| 397 | * |
| 398 | * - MUST set `fee_satoshis` less than or equal to the base |
| 399 | * fee of the final commitment transaction, as calculated |
| 400 | * in [BOLT #3](03-transactions.md#fee-calculation). |
| 401 | */ |
| 402 | feerange->max = commitment_fee; |
| 403 | |
| 404 | if (amount_sat_greater(offer[LOCAL], offer[REMOTE])) |
| 405 | feerange->higher_side = LOCAL; |
| 406 | else |
| 407 | feerange->higher_side = REMOTE; |
| 408 | |
| 409 | status_debug("Feerange init %s-%s, %s higher", |
| 410 | fmt_amount_sat(tmpctx, feerange->min), |
| 411 | fmt_amount_sat(tmpctx, feerange->max), |
| 412 | feerange->higher_side == LOCAL ? "local" : "remote"); |
| 413 | } |
| 414 | |
| 415 | static void adjust_feerange(struct feerange *feerange, |
| 416 | struct amount_sat offer, enum side side) |
no test coverage detected