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

Function find_best_out

common/permute_tx.c:78–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78static size_t find_best_out(struct wally_tx_output *outputs, const u32 *cltvs,
79 size_t num)
80{
81 size_t i, best = 0;
82
83 for (i = 1; i < num; i++) {
84 if (output_better(&outputs[i], cltv_of(cltvs, i),
85 &outputs[best], cltv_of(cltvs, best)))
86 best = i;
87 }
88 return best;
89}
90
91void permute_outputs(struct bitcoin_tx *tx, u32 *cltvs, const void **map)
92{

Callers 1

permute_outputsFunction · 0.85

Calls 2

output_betterFunction · 0.85
cltv_ofFunction · 0.85

Tested by

no test coverage detected