| 712 | } |
| 713 | |
| 714 | struct bitcoin_tx *fromwire_bitcoin_tx(const tal_t *ctx, |
| 715 | const u8 **cursor, size_t *max) |
| 716 | { |
| 717 | struct bitcoin_tx *tx; |
| 718 | |
| 719 | u32 len = fromwire_u32(cursor, max); |
| 720 | size_t start = *max; |
| 721 | tx = pull_bitcoin_tx(ctx, cursor, max); |
| 722 | if (!tx) |
| 723 | return fromwire_fail(cursor, max); |
| 724 | // Check that we consumed len bytes |
| 725 | if (start - *max != len) |
| 726 | return fromwire_fail(cursor, max); |
| 727 | |
| 728 | /* pull_bitcoin_tx sets the psbt */ |
| 729 | tal_free(tx->psbt); |
| 730 | tx->psbt = fromwire_wally_psbt(tx, cursor, max); |
| 731 | if (!tx->psbt) |
| 732 | return fromwire_fail(cursor, max); |
| 733 | |
| 734 | return tx; |
| 735 | } |
| 736 | |
| 737 | void towire_bitcoin_txid(u8 **pptr, const struct bitcoin_txid *txid) |
| 738 | { |
nothing calls this directly
no test coverage detected