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

Function new_channel

lightningd/channel.c:492–734  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

490}
491
492struct channel *new_channel(struct peer *peer, u64 dbid,
493 /* NULL or stolen */
494 struct wallet_shachain *their_shachain,
495 enum channel_state state,
496 enum side opener,
497 /* NULL or stolen */
498 struct logger *log,
499 const char *transient_billboard TAKES,
500 u8 channel_flags,
501 bool req_confirmed_ins_local,
502 bool req_confirmed_ins_remote,
503 const struct channel_config *our_config,
504 u32 minimum_depth,
505 u64 next_index_local,
506 u64 next_index_remote,
507 u64 next_htlc_id,
508 const struct bitcoin_outpoint *funding,
509 struct amount_sat funding_sats,
510 struct amount_msat push,
511 struct amount_sat our_funds,
512 bool remote_channel_ready,
513 /* NULL or stolen */
514 struct short_channel_id *scid TAKES,
515 struct short_channel_id *old_scids TAKES,
516 struct short_channel_id alias_local,
517 struct short_channel_id *alias_remote STEALS,
518 struct channel_id *cid,
519 struct amount_msat our_msat,
520 struct amount_msat msat_to_us_min,
521 struct amount_msat msat_to_us_max,
522 /* Stolen */
523 struct bitcoin_tx *last_tx,
524 const struct bitcoin_signature *last_sig,
525 /* NULL or stolen */
526 const struct bitcoin_signature *last_htlc_sigs,
527 const struct channel_info *channel_info,
528 const struct fee_states *fee_states TAKES,
529 /* NULL or stolen */
530 u8 *remote_shutdown_scriptpubkey,
531 const u8 *local_shutdown_scriptpubkey,
532 u64 final_key_idx,
533 bool last_was_revoke,
534 /* NULL or stolen */
535 struct changed_htlc *last_sent_commit,
536 u32 first_blocknum,
537 u32 min_possible_feerate,
538 u32 max_possible_feerate,
539 const struct basepoints *local_basepoints,
540 const struct pubkey *local_funding_pubkey,
541 bool has_future_per_commitment_point,
542 u32 feerate_base,
543 u32 feerate_ppm,
544 const u8 *remote_upfront_shutdown_script,
545 u64 local_static_remotekey_start,
546 u64 remote_static_remotekey_start,
547 const struct channel_type *type STEALS,
548 enum side closer,
549 u32 close_attempt_height,

Callers 2

wallet_commit_channelFunction · 0.70
stub_chanFunction · 0.70

Calls 15

feature_negotiatedFunction · 0.85
shachain_initFunction · 0.85
is_stub_scidFunction · 0.85
chanmap_addFunction · 0.85
dup_fee_statesFunction · 0.85
p2tr_for_keyidxFunction · 0.85
p2wpkh_for_keyidxFunction · 0.85
dup_height_statesFunction · 0.85
amount_msat_greaterFunction · 0.85
add_channel_to_dbid_mapFunction · 0.85
list_head_initFunction · 0.85
channel_gossip_initFunction · 0.85

Tested by

no test coverage detected