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

Function new_inflight

lightningd/channel.c:176–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176struct channel_inflight *
177new_inflight(struct channel *channel,
178 struct pubkey *remote_funding,
179 const struct bitcoin_outpoint *funding_outpoint,
180 u32 funding_feerate,
181 struct amount_sat total_funds,
182 struct amount_sat our_funds,
183 struct wally_psbt *psbt STEALS,
184 const u32 lease_expiry,
185 const secp256k1_ecdsa_signature *lease_commit_sig,
186 const u32 lease_chan_max_msat, const u16 lease_chan_max_ppt,
187 const u32 lease_blockheight_start,
188 const struct amount_msat lease_fee,
189 const struct amount_sat lease_amt,
190 s64 splice_amnt,
191 bool i_am_initiator,
192 bool force_sign_first,
193 bool i_sent_sigs)
194{
195 struct channel_inflight *inflight
196 = tal(channel, struct channel_inflight);
197 struct funding_info *funding
198 = tal(inflight, struct funding_info);
199
200 funding->outpoint = *funding_outpoint;
201 funding->total_funds = total_funds;
202 funding->feerate = funding_feerate;
203 funding->our_funds = our_funds;
204 funding->splice_amnt = splice_amnt;
205 funding->splice_remote_funding = tal_steal(funding, remote_funding);
206
207 inflight->funding = funding;
208 inflight->channel = channel;
209 inflight->remote_tx_sigs = false;
210 inflight->funding_psbt = tal_steal(inflight, psbt);
211 inflight->last_tx = NULL;
212 inflight->tx_broadcast = false;
213 inflight->scid = NULL;
214
215 /* Channel lease infos */
216 inflight->lease_blockheight_start = lease_blockheight_start;
217 inflight->lease_expiry = lease_expiry;
218 inflight->lease_commit_sig
219 = tal_dup_or_null(inflight, secp256k1_ecdsa_signature,
220 lease_commit_sig);
221
222 inflight->lease_chan_max_msat = lease_chan_max_msat;
223 inflight->lease_chan_max_ppt = lease_chan_max_ppt;
224 inflight->lease_fee = lease_fee;
225 inflight->lease_amt = lease_amt;
226
227 inflight->i_am_initiator = i_am_initiator;
228 inflight->force_sign_first = force_sign_first;
229 inflight->locked_scid = NULL;
230 inflight->i_sent_sigs = i_sent_sigs;
231 inflight->splice_locked_memonly = false;
232
233 list_add_tail(&channel->inflights, &inflight->list);

Callers 4

wallet_update_channelFunction · 0.70
wallet_commit_channelFunction · 0.70
handle_add_inflightFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected