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

Function new_channel

lightningd/channel.c:500–745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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