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

Function handle_commit_received

lightningd/dual_open_control.c:2868–3050  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2866}
2867
2868static void handle_commit_received(struct subd *dualopend,
2869 struct channel *channel,
2870 const u8 *msg)
2871{
2872 struct lightningd *ld = dualopend->ld;
2873 struct open_attempt *oa = channel->open_attempt;
2874 struct channel_info channel_info;
2875 struct bitcoin_tx *remote_commit;
2876 struct bitcoin_signature remote_commit_sig;
2877 struct bitcoin_outpoint funding;
2878 u16 lease_chan_max_ppt;
2879 u32 feerate_funding, feerate_commitment, lease_expiry,
2880 lease_chan_max_msat, lease_blockheight_start;
2881 struct amount_sat total_funding, funding_ours, lease_fee;
2882 u8 *remote_upfront_shutdown_script,
2883 *local_upfront_shutdown_script;
2884 struct penalty_base *pbase;
2885 struct wally_psbt *psbt;
2886 struct json_stream *response;
2887 struct openchannel2_psbt_payload *payload;
2888 struct channel_inflight *inflight;
2889 struct command *cmd = oa->cmd;
2890 secp256k1_ecdsa_signature *lease_commit_sig;
2891
2892 if (!fromwire_dualopend_commit_rcvd(tmpctx, msg,
2893 &channel_info.their_config,
2894 &remote_commit,
2895 &pbase,
2896 &remote_commit_sig,
2897 &psbt,
2898 &channel_info.theirbase.revocation,
2899 &channel_info.theirbase.payment,
2900 &channel_info.theirbase.htlc,
2901 &channel_info.theirbase.delayed_payment,
2902 &channel_info.remote_per_commit,
2903 &channel_info.remote_fundingkey,
2904 &funding,
2905 &total_funding,
2906 &funding_ours,
2907 &channel->channel_flags,
2908 &feerate_funding,
2909 &feerate_commitment,
2910 &local_upfront_shutdown_script,
2911 &remote_upfront_shutdown_script,
2912 &lease_blockheight_start,
2913 &lease_expiry,
2914 &lease_fee,
2915 &lease_commit_sig,
2916 &lease_chan_max_msat,
2917 &lease_chan_max_ppt)) {
2918 channel_internal_error(channel,
2919 "Bad WIRE_DUALOPEND_COMMIT_RCVD: %s",
2920 tal_hex(msg, msg));
2921 channel->open_attempt = tal_free(channel->open_attempt);
2922 notify_channel_open_failed(channel->peer->ld, &channel->cid);
2923 return;
2924 }
2925

Callers 1

dual_opend_msgFunction · 0.85

Calls 15

tal_hexFunction · 0.85
tal_freeFunction · 0.85
wallet_penalty_base_addFunction · 0.85
wallet_update_channelFunction · 0.85
channel_err_brokenFunction · 0.85
json_add_psbtFunction · 0.85
was_pendingFunction · 0.85
clone_psbtFunction · 0.85
abortFunction · 0.85
channel_internal_errorFunction · 0.70
channel_update_reserveFunction · 0.70

Tested by

no test coverage detected