| 581 | } |
| 582 | |
| 583 | static const struct short_channel_id_dir * |
| 584 | payment_get_excluded_channels(const tal_t *ctx, struct payment *p) |
| 585 | { |
| 586 | struct payment *root = payment_root(p); |
| 587 | struct channel_hint *hint; |
| 588 | struct short_channel_id_dir *res = |
| 589 | tal_arr(ctx, struct short_channel_id_dir, 0); |
| 590 | for (size_t i = 0; i < tal_count(root->channel_hints); i++) { |
| 591 | hint = &root->channel_hints[i]; |
| 592 | |
| 593 | if (!hint->enabled) |
| 594 | tal_arr_expand(&res, hint->scid); |
| 595 | |
| 596 | else if (amount_msat_greater(p->amount, |
| 597 | hint->estimated_capacity)) |
| 598 | tal_arr_expand(&res, hint->scid); |
| 599 | |
| 600 | else if (hint->local && hint->htlc_budget == 0) |
| 601 | /* If we cannot add any HTLCs to the channel we |
| 602 | * shouldn't look for a route through that channel */ |
| 603 | tal_arr_expand(&res, hint->scid); |
| 604 | } |
| 605 | return res; |
| 606 | } |
| 607 | |
| 608 | static const struct node_id *payment_get_excluded_nodes(const tal_t *ctx, |
| 609 | struct payment *p) |
no test coverage detected