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

Function payment_max_htlcs

plugins/libplugin-pay.c:3459–3475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3457}
3458
3459static u32 payment_max_htlcs(const struct payment *p)
3460{
3461 const struct payment *root;
3462 struct channel_hint *h;
3463 u32 res = 0;
3464 for (size_t i = 0; i < tal_count(p->channel_hints); i++) {
3465 h = &p->channel_hints[i];
3466 if (h->local && h->enabled)
3467 res += h->htlc_budget;
3468 }
3469 root = p;
3470 while (root->parent)
3471 root = root->parent;
3472 if (res > root->max_htlcs)
3473 res = root->max_htlcs;
3474 return res;
3475}
3476
3477/** payment_lower_max_htlcs
3478 *

Callers 2

presplit_cbFunction · 0.85
adaptive_splitter_cbFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected