| 3457 | } |
| 3458 | |
| 3459 | static 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 | * |
no outgoing calls
no test coverage detected