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

Function find_best_out

common/permute_tx.c:71–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71static size_t find_best_out(struct wally_tx_output *outputs, const u32 *cltvs,
72 size_t num)
73{
74 size_t i, best = 0;
75
76 for (i = 1; i < num; i++) {
77 if (output_better(&outputs[i], cltv_of(cltvs, i),
78 &outputs[best], cltv_of(cltvs, best)))
79 best = i;
80 }
81 return best;
82}
83
84void permute_outputs(struct bitcoin_tx *tx, u32 *cltvs, const void **map)
85{

Callers 1

permute_outputsFunction · 0.85

Calls 2

output_betterFunction · 0.85
cltv_ofFunction · 0.85

Tested by

no test coverage detected