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

Function handle_init

tests/plugins/channeld_fakenet.c:1037–1172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1035}
1036
1037static struct channel *handle_init(struct info *info, const u8 *init_msg)
1038{
1039 struct feature_set *our_features;
1040 u32 *hsm_capabilities;
1041 struct channel_id channel_id;
1042 struct basepoints points[NUM_SIDES];
1043 struct amount_sat funding_sats;
1044 struct amount_msat local_msat;
1045 struct pubkey funding_pubkey[NUM_SIDES];
1046 struct channel_config conf[NUM_SIDES];
1047 struct bitcoin_outpoint funding;
1048 enum side opener;
1049 struct existing_htlc **htlcs;
1050 bool reconnected;
1051 u32 final_index;
1052 struct ext_key final_ext_key;
1053 u8 *fwd_msg;
1054 u32 minimum_depth, lease_expiry;
1055 struct secret last_remote_per_commit_secret;
1056 struct penalty_base *pbases;
1057 struct channel_type *channel_type;
1058 u32 feerate_splice, feerate_min, feerate_max, feerate_penalty, feerate_opening;
1059 struct pubkey remote_per_commit;
1060 struct pubkey old_remote_per_commit;
1061 u32 commit_msec;
1062 bool last_was_revoke;
1063 struct changed_htlc *last_sent_commit;
1064 u64 revocations_received;
1065 u8 channel_flags;
1066 bool channel_ready[NUM_SIDES];
1067 u64 next_index[NUM_SIDES];
1068 u64 htlc_id;
1069 struct bitcoin_signature their_commit_sig;
1070 struct short_channel_id short_channel_ids[NUM_SIDES];
1071 bool send_shutdown;
1072 bool shutdown_sent[NUM_SIDES];
1073 u8 *final_scriptpubkey;
1074 u8 *their_features;
1075 u8 *remote_upfront_shutdown_script;
1076 u32 *dev_disable_commit;
1077 struct inflight **inflights;
1078 struct short_channel_id local_alias;
1079 struct channel *channel;
1080 const u8 *wscript;
1081 char *err_reason;
1082 struct wally_tx_output *direct_outputs[NUM_SIDES];
1083 struct htlc_map *htlc_map;
1084
1085 if (!fromwire_channeld_init(info, init_msg,
1086 &chainparams,
1087 &our_features,
1088 &hsm_capabilities,
1089 &channel_id,
1090 &funding,
1091 &funding_sats,
1092 &minimum_depth,
1093 &info->current_block_height,
1094 &info->blockheight_states,

Callers 1

recv_reqFunction · 0.70

Calls 5

abortFunction · 0.85
new_full_channelFunction · 0.85
feature_offeredFunction · 0.85
initial_channel_txFunction · 0.85
daemon_conn_sendFunction · 0.85

Tested by

no test coverage detected