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

Function sort_inputs

common/psbt_open.c:163–185  ·  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].tx_input = psbt->tx->inputs[i];
172 set[i].input = psbt->inputs[i];
173 }
174
175 asort(set, tal_count(set),
176 compare_inputs_at, NULL);
177
178 /* Put PSBT parts into place */
179 for (size_t i = 0; i < tal_count(set); i++) {
180 psbt->inputs[i] = set[i].input;
181 psbt->tx->inputs[i] = set[i].tx_input;
182 }
183
184 tal_free(set);
185}
186
187static void sort_outputs(struct wally_psbt *psbt)
188{

Callers 1

psbt_sort_by_serial_idFunction · 0.85

Calls 1

tal_freeFunction · 0.85

Tested by

no test coverage detected