MCPcopy Create free account
hub / github.com/ElementsProject/lightning / fromwire_inflight

Function fromwire_inflight

channeld/inflight.c:7–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include <wire/wire.h>
6
7struct 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
41void towire_inflight(u8 **pptr, const struct inflight *inflight)
42{

Callers

nothing calls this directly

Calls 10

fromwire_pubkeyFunction · 0.85
fromwire_wally_psbtFunction · 0.85
fromwire_s64Function · 0.85
fromwire_bitcoin_txFunction · 0.85
fromwire_amount_satFunction · 0.50
fromwire_boolFunction · 0.50
fromwire_u8Function · 0.50

Tested by

no test coverage detected