| 354 | } |
| 355 | |
| 356 | int psbt_find_serial_output(struct wally_psbt *psbt, u64 serial_id) |
| 357 | { |
| 358 | for (size_t i = 0; i < psbt->num_outputs; i++) { |
| 359 | u64 out_serial; |
| 360 | if (!psbt_get_serial_id(&psbt->outputs[i].unknowns, &out_serial)) |
| 361 | continue; |
| 362 | if (out_serial == serial_id) |
| 363 | return i; |
| 364 | } |
| 365 | return -1; |
| 366 | } |
| 367 | |
| 368 | static u64 get_random_serial(enum tx_role role) |
| 369 | { |