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

Function get_best_candidate

lightningd/plugin_hook.c:606–620  ·  view source on GitHub ↗

Sometimes naive is best. */

Source from the content-addressed store, hash-verified

604
605/* Sometimes naive is best. */
606static struct hook_node *get_best_candidate(struct hook_node *graph)
607{
608 struct hook_node *best = NULL;
609
610 for (size_t i = 0; i < tal_count(graph); i++) {
611 if (graph[i].finished)
612 continue;
613 if (graph[i].num_incoming != 0)
614 continue;
615 if (!best
616 || best->hook->plugin->index > graph[i].hook->plugin->index)
617 best = &graph[i];
618 }
619 return best;
620}
621
622static struct plugin **plugin_hook_make_ordered(const tal_t *ctx,
623 struct logger *log,

Callers 1

plugin_hook_make_orderedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected