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

Function dst_is_excluded

plugins/libplugin-pay.c:650–668  ·  view source on GitHub ↗

FIXME: This is slow! */

Source from the content-addressed store, hash-verified

648
649/* FIXME: This is slow! */
650static bool dst_is_excluded(const struct gossmap *gossmap,
651 const struct gossmap_chan *c,
652 int dir,
653 const struct node_id *nodes)
654{
655 struct node_id dstid;
656
657 /* Premature optimization */
658 if (!tal_count(nodes))
659 return false;
660
661 gossmap_node_get_id(gossmap, gossmap_nth_node(gossmap, c, !dir),
662 &dstid);
663 for (size_t i = 0; i < tal_count(nodes); i++) {
664 if (node_id_eq(&dstid, &nodes[i]))
665 return true;
666 }
667 return false;
668}
669
670static bool payment_route_check(const struct gossmap *gossmap,
671 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