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

Function sort_inputs

common/psbt_open.c:163–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163static void sort_inputs(struct wally_psbt *psbt)
164{
165 /* Build an input map */
166 struct input_set *set = tal_arr(NULL,
167 struct input_set,
168 psbt->num_inputs);
169
170 for (size_t i = 0; i < tal_count(set); i++) {
171 set[i].input = psbt->inputs[i];
172 }
173
174 asort(set, tal_count(set),
175 compare_inputs_at, NULL);
176
177 /* Put PSBT parts into place */
178 for (size_t i = 0; i < tal_count(set); i++) {
179 psbt->inputs[i] = set[i].input;
180 }
181
182 tal_free(set);
183}
184
185static void sort_outputs(struct wally_psbt *psbt)
186{

Callers 1

psbt_sort_by_serial_idFunction · 0.85

Calls 1

tal_freeFunction · 0.85

Tested by

no test coverage detected