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

Function payment_route_fee

plugins/libplugin-pay.c:430–445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

428}
429
430static struct amount_msat payment_route_fee(struct payment *p)
431{
432 struct amount_msat fee;
433 if (!amount_msat_sub(&fee, p->route[0].amount, p->amount)) {
434 paymod_log(
435 p,
436 LOG_BROKEN,
437 "gossipd returned a route with a negative fee: sending %s "
438 "to deliver %s",
439 type_to_string(tmpctx, struct amount_msat,
440 &p->route[0].amount),
441 type_to_string(tmpctx, struct amount_msat, &p->amount));
442 abort();
443 }
444 return fee;
445}
446
447/* Update the constraints by subtracting the delta_fee and delta_cltv if the
448 * 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
type_to_stringClass · 0.50

Tested by

no test coverage detected