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

Function dst_is_excluded

plugins/libplugin-pay.c:629–647  ·  view source on GitHub ↗

FIXME: This is slow! */

Source from the content-addressed store, hash-verified

627
628/* FIXME: This is slow! */
629static bool dst_is_excluded(const struct gossmap *gossmap,
630 const struct gossmap_chan *c,
631 int dir,
632 const struct node_id *nodes)
633{
634 struct node_id dstid;
635
636 /* Premature optimization */
637 if (!tal_count(nodes))
638 return false;
639
640 gossmap_node_get_id(gossmap, gossmap_nth_node(gossmap, c, !dir),
641 &dstid);
642 for (size_t i = 0; i < tal_count(nodes); i++) {
643 if (node_id_eq(&dstid, &nodes[i]))
644 return true;
645 }
646 return false;
647}
648
649static bool payment_route_check(const struct gossmap *gossmap,
650 const struct gossmap_chan *c,

Callers 1

payment_route_checkFunction · 0.85

Calls 3

gossmap_node_get_idFunction · 0.85
gossmap_nth_nodeFunction · 0.85
node_id_eqFunction · 0.85

Tested by

no test coverage detected