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

Function get_best_candidate

lightningd/plugin_hook.c:595–609  ·  view source on GitHub ↗

Sometimes naive is best. */

Source from the content-addressed store, hash-verified

593
594/* Sometimes naive is best. */
595static struct hook_node *get_best_candidate(struct hook_node *graph)
596{
597 struct hook_node *best = NULL;
598
599 for (size_t i = 0; i < tal_count(graph); i++) {
600 if (graph[i].finished)
601 continue;
602 if (graph[i].num_incoming != 0)
603 continue;
604 if (!best
605 || best->hook->plugin->index > graph[i].hook->plugin->index)
606 best = &graph[i];
607 }
608 return best;
609}
610
611static struct plugin **plugin_hook_make_ordered(const tal_t *ctx,
612 struct logger *log,

Callers 1

plugin_hook_make_orderedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected