| 426 | } |
| 427 | |
| 428 | u8 *linearize_wtx(const tal_t *ctx, const struct wally_tx *wtx) |
| 429 | { |
| 430 | u8 *arr; |
| 431 | u32 flag = 0; |
| 432 | size_t len, written; |
| 433 | int res; |
| 434 | |
| 435 | if (uses_witness(wtx)) |
| 436 | flag |= WALLY_TX_FLAG_USE_WITNESS; |
| 437 | |
| 438 | res = wally_tx_get_length(wtx, flag, &len); |
| 439 | assert(res == WALLY_OK); |
| 440 | arr = tal_arr(ctx, u8, len); |
| 441 | res = wally_tx_to_bytes(wtx, flag, arr, len, &written); |
| 442 | assert(len == written); |
| 443 | |
| 444 | return arr; |
| 445 | } |
| 446 | |
| 447 | size_t wally_tx_weight(const struct wally_tx *wtx) |
| 448 | { |
no test coverage detected