| 303 | } |
| 304 | |
| 305 | u8 *bitcoin_tx_output_get_witscript(const tal_t *ctx, const struct bitcoin_tx *tx, |
| 306 | int outnum) |
| 307 | { |
| 308 | struct wally_psbt_output *out; |
| 309 | const struct wally_map_item *output_witness_script; |
| 310 | |
| 311 | assert(outnum < tx->psbt->num_outputs); |
| 312 | out = &tx->psbt->outputs[outnum]; |
| 313 | |
| 314 | output_witness_script = wally_map_get_integer(&out->psbt_fields, /* PSBT_OUT_WITNESS_SCRIPT */ 0x01); |
| 315 | if (output_witness_script->value_len == 0) |
| 316 | return NULL; |
| 317 | |
| 318 | return tal_dup_arr(ctx, u8, output_witness_script->value, output_witness_script->value_len, 0); |
| 319 | } |
| 320 | |
| 321 | struct amount_asset bitcoin_tx_output_get_amount(const struct bitcoin_tx *tx, |
| 322 | int outnum) |
no outgoing calls
no test coverage detected