| 33 | } |
| 34 | |
| 35 | static u8 *next_script(const tal_t *ctx, const u8 **cursor, size_t *max) |
| 36 | { |
| 37 | const u8 *p; |
| 38 | size_t size; |
| 39 | u8 *ret; |
| 40 | |
| 41 | if (!next_size(cursor, max, &size)) |
| 42 | return NULL; |
| 43 | |
| 44 | if (*max < size) { |
| 45 | *max = 0; |
| 46 | return NULL; |
| 47 | } |
| 48 | |
| 49 | p = *cursor; |
| 50 | *max -= size; |
| 51 | *cursor += size; |
| 52 | |
| 53 | ret = tal_arr(ctx, u8, size); |
| 54 | memcpy(ret, p, size); |
| 55 | return ret; |
| 56 | } |
| 57 | |
| 58 | static void |
| 59 | psbt_input_set_final_witness_stack(const tal_t *ctx, |
no test coverage detected