| 438 | } |
| 439 | |
| 440 | u8 *linearize_wtx(const tal_t *ctx, const struct wally_tx *wtx) |
| 441 | { |
| 442 | u8 *arr; |
| 443 | u32 flag = 0; |
| 444 | size_t len, written; |
| 445 | int res; |
| 446 | |
| 447 | if (uses_witness(wtx)) |
| 448 | flag |= WALLY_TX_FLAG_USE_WITNESS; |
| 449 | |
| 450 | res = wally_tx_get_length(wtx, flag, &len); |
| 451 | assert(res == WALLY_OK); |
| 452 | arr = tal_arr(ctx, u8, len); |
| 453 | res = wally_tx_to_bytes(wtx, flag, arr, len, &written); |
| 454 | assert(len == written); |
| 455 | |
| 456 | return arr; |
| 457 | } |
| 458 | |
| 459 | size_t wally_tx_weight(const struct wally_tx *wtx) |
| 460 | { |
no test coverage detected