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

Function new_channel

lightningd/channel.c:330–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

328}
329
330struct channel *new_channel(struct peer *peer, u64 dbid,
331 /* NULL or stolen */
332 struct wallet_shachain *their_shachain,
333 enum channel_state state,
334 enum side opener,
335 /* NULL or stolen */
336 struct log *log,
337 const char *transient_billboard TAKES,
338 u8 channel_flags,
339 const struct channel_config *our_config,
340 u32 minimum_depth,
341 u64 next_index_local,
342 u64 next_index_remote,
343 u64 next_htlc_id,
344 const struct bitcoin_outpoint *funding,
345 struct amount_sat funding_sats,
346 struct amount_msat push,
347 struct amount_sat our_funds,
348 bool remote_channel_ready,
349 /* NULL or stolen */
350 struct short_channel_id *scid,
351 struct short_channel_id *alias_local STEALS,
352 struct short_channel_id *alias_remote STEALS,
353 struct channel_id *cid,
354 struct amount_msat our_msat,
355 struct amount_msat msat_to_us_min,
356 struct amount_msat msat_to_us_max,
357 /* Stolen */
358 struct bitcoin_tx *last_tx,
359 const struct bitcoin_signature *last_sig,
360 /* NULL or stolen */
361 const struct bitcoin_signature *last_htlc_sigs,
362 const struct channel_info *channel_info,
363 const struct fee_states *fee_states TAKES,
364 /* NULL or stolen */
365 u8 *remote_shutdown_scriptpubkey,
366 const u8 *local_shutdown_scriptpubkey,
367 u64 final_key_idx,
368 bool last_was_revoke,
369 /* NULL or stolen */
370 struct changed_htlc *last_sent_commit,
371 u32 first_blocknum,
372 u32 min_possible_feerate,
373 u32 max_possible_feerate,
374 const struct basepoints *local_basepoints,
375 const struct pubkey *local_funding_pubkey,
376 const struct pubkey *future_per_commitment_point,
377 u32 feerate_base,
378 u32 feerate_ppm,
379 const u8 *remote_upfront_shutdown_script,
380 u64 local_static_remotekey_start,
381 u64 remote_static_remotekey_start,
382 const struct channel_type *type STEALS,
383 enum side closer,
384 enum state_change reason,
385 /* NULL or stolen */
386 const struct bitcoin_outpoint *shutdown_wrong_funding,
387 const struct height_states *height_states TAKES,

Callers 2

wallet_commit_channelFunction · 0.70
stub_chanFunction · 0.70

Calls 13

shachain_initFunction · 0.85
channel_type_dupFunction · 0.85
dup_fee_statesFunction · 0.85
p2wpkh_for_keyidxFunction · 0.85
dup_height_statesFunction · 0.85
amount_msat_greaterFunction · 0.85
amount_msat_lessFunction · 0.85
list_head_initFunction · 0.85
is_stub_scidFunction · 0.85
new_logFunction · 0.70
htlc_max_possible_sendFunction · 0.70

Tested by

no test coverage detected