| 457 | } |
| 458 | |
| 459 | static struct amount_msat payment_route_fee(struct payment *p) |
| 460 | { |
| 461 | struct amount_msat fee; |
| 462 | if (!amount_msat_sub(&fee, p->route[0].amount, p->our_amount)) { |
| 463 | paymod_log( |
| 464 | p, |
| 465 | LOG_BROKEN, |
| 466 | "gossipd returned a route with a negative fee: sending %s " |
| 467 | "to deliver %s", |
| 468 | fmt_amount_msat(tmpctx, p->route[0].amount), |
| 469 | fmt_amount_msat(tmpctx, p->our_amount)); |
| 470 | abort(); |
| 471 | } |
| 472 | return fee; |
| 473 | } |
| 474 | |
| 475 | /* Update the constraints by subtracting the delta_fee and delta_cltv if the |
| 476 | * result is positive. Returns whether or not the update has been applied. */ |
no test coverage detected