| 482 | } |
| 483 | |
| 484 | const u8 *psbt_input_get_witscript(const tal_t *ctx, |
| 485 | const struct wally_psbt *psbt, |
| 486 | size_t in) |
| 487 | { |
| 488 | size_t witscript_len, written_len; |
| 489 | u8 *witscript; |
| 490 | if (wally_psbt_get_input_witness_script_len(psbt, in, &witscript_len) != WALLY_OK) |
| 491 | abort(); |
| 492 | witscript = tal_arr(ctx, u8, witscript_len); |
| 493 | if (wally_psbt_get_input_witness_script(psbt, in, witscript, witscript_len, &written_len) != WALLY_OK) |
| 494 | abort(); |
| 495 | if (witscript_len != written_len) |
| 496 | abort(); |
| 497 | return witscript; |
| 498 | } |
| 499 | |
| 500 | bool psbt_input_get_ecdsa_sig(const tal_t *ctx, |
| 501 | const struct wally_psbt *psbt, |