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

Function get_best_candidate

lightningd/plugin_hook.c:467–481  ·  view source on GitHub ↗

Sometimes naive is best. */

Source from the content-addressed store, hash-verified

465
466/* Sometimes naive is best. */
467static struct hook_node *get_best_candidate(struct hook_node *graph)
468{
469 struct hook_node *best = NULL;
470
471 for (size_t i = 0; i < tal_count(graph); i++) {
472 if (graph[i].finished)
473 continue;
474 if (graph[i].num_incoming != 0)
475 continue;
476 if (!best
477 || best->hook->plugin->index > graph[i].hook->plugin->index)
478 best = &graph[i];
479 }
480 return best;
481}
482
483static struct plugin **plugin_hook_make_ordered(const tal_t *ctx,
484 struct plugin_hook *hook)

Callers 1

plugin_hook_make_orderedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected