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

Function payment_route_fee

plugins/libplugin-pay.c:459–473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

457}
458
459static 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. */

Callers 1

payment_getrouteFunction · 0.85

Calls 4

amount_msat_subFunction · 0.85
paymod_logFunction · 0.85
abortFunction · 0.85
fmt_amount_msatFunction · 0.50

Tested by

no test coverage detected