| 758 | } |
| 759 | |
| 760 | struct bitcoin_tx *fromwire_bitcoin_tx(const tal_t *ctx, |
| 761 | const u8 **cursor, size_t *max) |
| 762 | { |
| 763 | struct bitcoin_tx *tx; |
| 764 | |
| 765 | u32 len = fromwire_u32(cursor, max); |
| 766 | size_t start = *max; |
| 767 | tx = pull_bitcoin_tx_only(ctx, cursor, max); |
| 768 | if (!tx) |
| 769 | return fromwire_fail(cursor, max); |
| 770 | // Check that we consumed len bytes |
| 771 | if (start - *max != len) |
| 772 | return fromwire_fail(cursor, max); |
| 773 | |
| 774 | tx->psbt = fromwire_wally_psbt(tx, cursor, max); |
| 775 | if (!tx->psbt) |
| 776 | return fromwire_fail(cursor, max); |
| 777 | |
| 778 | return tx; |
| 779 | } |
| 780 | |
| 781 | void towire_bitcoin_txid(u8 **pptr, const struct bitcoin_txid *txid) |
| 782 | { |