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

Function payment_exclude_longest_delay

plugins/libplugin-pay.c:414–428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412}
413
414static void payment_exclude_longest_delay(struct payment *p)
415{
416 struct route_hop *e = &p->route[0];
417 u32 delay, worst = 0;
418
419 for (size_t i = 0; i < tal_count(p->route)-1; i++) {
420 delay = p->route[i].delay - p->route[i+1].delay;
421 if (delay >= worst) {
422 e = &p->route[i];
423 worst = delay;
424 }
425 }
426 channel_hints_update(p, e->scid, e->direction, false, false,
427 NULL, NULL);
428}
429
430static struct amount_msat payment_route_fee(struct payment *p)
431{

Callers 1

payment_getrouteFunction · 0.85

Calls 1

channel_hints_updateFunction · 0.85

Tested by

no test coverage detected