| 5 | #include <wire/wire.h> |
| 6 | |
| 7 | struct inflight *fromwire_inflight(const tal_t *ctx, const u8 **cursor, size_t *max) |
| 8 | { |
| 9 | struct inflight *inflight = tal(ctx, struct inflight); |
| 10 | |
| 11 | fromwire_bitcoin_outpoint(cursor, max, &inflight->outpoint); |
| 12 | fromwire_pubkey(cursor, max, &inflight->remote_funding); |
| 13 | inflight->amnt = fromwire_amount_sat(cursor, max); |
| 14 | inflight->remote_tx_sigs = fromwire_bool(cursor, max); |
| 15 | inflight->psbt = fromwire_wally_psbt(inflight, cursor, max); |
| 16 | inflight->splice_amnt = fromwire_s64(cursor, max); |
| 17 | int has_tx = fromwire_u8(cursor, max); |
| 18 | if(has_tx) { |
| 19 | inflight->last_tx = fromwire_bitcoin_tx(inflight, cursor, max); |
| 20 | fromwire_bitcoin_signature(cursor, max, &inflight->last_sig); |
| 21 | } |
| 22 | else { |
| 23 | inflight->last_tx = NULL; |
| 24 | memset(&inflight->last_sig, 0, sizeof(inflight->last_sig)); |
| 25 | } |
| 26 | inflight->i_am_initiator = fromwire_bool(cursor, max); |
| 27 | inflight->force_sign_first = fromwire_bool(cursor, max); |
| 28 | int has_locked_scid = fromwire_u8(cursor, max); |
| 29 | if (has_locked_scid) { |
| 30 | inflight->locked_scid = tal(inflight, struct short_channel_id); |
| 31 | *inflight->locked_scid = fromwire_short_channel_id(cursor, max); |
| 32 | } |
| 33 | else { |
| 34 | inflight->locked_scid = NULL; |
| 35 | } |
| 36 | inflight->i_sent_sigs = fromwire_bool(cursor, max); |
| 37 | |
| 38 | return inflight; |
| 39 | } |
| 40 | |
| 41 | void towire_inflight(u8 **pptr, const struct inflight *inflight) |
| 42 | { |
nothing calls this directly
no test coverage detected