| 603 | } |
| 604 | |
| 605 | static struct wally_tx *pull_wtx(const tal_t *ctx, |
| 606 | const u8 **cursor, |
| 607 | size_t *max) |
| 608 | { |
| 609 | int flags = WALLY_TX_FLAG_USE_WITNESS; |
| 610 | struct wally_tx *wtx; |
| 611 | |
| 612 | if (chainparams->is_elements) |
| 613 | flags |= WALLY_TX_FLAG_USE_ELEMENTS; |
| 614 | |
| 615 | tal_wally_start(); |
| 616 | if (wally_tx_from_bytes(*cursor, *max, flags, &wtx) != WALLY_OK) { |
| 617 | fromwire_fail(cursor, max); |
| 618 | wtx = tal_free(wtx); |
| 619 | } |
| 620 | tal_wally_end_onto(ctx, wtx, struct wally_tx); |
| 621 | |
| 622 | if (wtx) { |
| 623 | size_t wsize; |
| 624 | wally_tx_get_length(wtx, flags, &wsize); |
| 625 | *cursor += wsize; |
| 626 | *max -= wsize; |
| 627 | } |
| 628 | |
| 629 | return wtx; |
| 630 | } |
| 631 | |
| 632 | struct bitcoin_tx *pull_bitcoin_tx_only(const tal_t *ctx, const u8 **cursor, |
| 633 | size_t *max) |
no test coverage detected