| 49 | } |
| 50 | |
| 51 | static struct wally_tx_output *clone_output(const struct wally_tx_output *src) |
| 52 | { |
| 53 | struct wally_tx_output *out; |
| 54 | int ret; |
| 55 | |
| 56 | if (is_elements(chainparams)) { |
| 57 | ret = wally_tx_elements_output_init_alloc |
| 58 | (src->script, src->script_len, |
| 59 | src->asset, src->asset_len, |
| 60 | src->value, src->value_len, |
| 61 | src->nonce, src->nonce_len, |
| 62 | src->surjectionproof, src->surjectionproof_len, |
| 63 | src->rangeproof, src->rangeproof_len, |
| 64 | &out); |
| 65 | } else { |
| 66 | ret = wally_tx_output_init_alloc(src->satoshi, |
| 67 | src->script, src->script_len, |
| 68 | &out); |
| 69 | } |
| 70 | assert(ret == WALLY_OK); |
| 71 | |
| 72 | tal_add_destructor(out, destroy_wally_tx_output); |
| 73 | return out; |
| 74 | } |
| 75 | |
| 76 | struct tx_parts *tx_parts_from_wally_tx(const tal_t *ctx, |
| 77 | const struct wally_tx *wtx, |
no test coverage detected