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

Function payment_get_excluded_channels

plugins/libplugin-pay.c:616–640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

614}
615
616static const struct short_channel_id_dir *
617payment_get_excluded_channels(const tal_t *ctx, struct payment *p)
618{
619 struct payment *root = payment_root(p);
620 struct channel_hint *hint;
621 struct channel_hint_map_iter iter;
622 struct short_channel_id_dir *res =
623 tal_arr(ctx, struct short_channel_id_dir, 0);
624 for (hint = channel_hint_map_first(root->hints->hints, &iter);
625 hint;
626 hint = channel_hint_map_next(root->hints->hints, &iter)) {
627 if (!hint->enabled)
628 tal_arr_expand(&res, hint->scid);
629
630 else if (amount_msat_greater(p->our_amount,
631 hint->estimated_capacity))
632 tal_arr_expand(&res, hint->scid);
633
634 else if (hint->local && hint->local->htlc_budget == 0)
635 /* If we cannot add any HTLCs to the channel we
636 * shouldn't look for a route through that channel */
637 tal_arr_expand(&res, hint->scid);
638 }
639 return res;
640}
641
642static const struct node_id *payment_get_excluded_nodes(const tal_t *ctx,
643 struct payment *p)

Callers 1

routehint_excludedFunction · 0.85

Calls 2

payment_rootFunction · 0.85
amount_msat_greaterFunction · 0.85

Tested by

no test coverage detected