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

Function opening_funder_finished

lightningd/opening_control.c:370–474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

368}
369
370static void opening_funder_finished(struct subd *openingd, const u8 *resp,
371 const int *fds,
372 struct funding_channel *fc)
373{
374 struct channel_info channel_info;
375 struct channel_id cid;
376 struct bitcoin_outpoint funding;
377 struct bitcoin_signature remote_commit_sig;
378 struct bitcoin_tx *remote_commit;
379 u32 feerate;
380 struct channel *channel;
381 struct lightningd *ld = openingd->ld;
382 u8 *remote_upfront_shutdown_script;
383 struct peer_fd *peer_fd;
384 struct penalty_base *pbase;
385 struct channel_type *type;
386 bool was_important;
387
388 /* This is a new channel_info.their_config so set its ID to 0 */
389 channel_info.their_config.id = 0;
390
391 if (!fromwire_openingd_funder_reply(resp, resp,
392 &channel_info.their_config,
393 &remote_commit,
394 &pbase,
395 &remote_commit_sig,
396 &channel_info.theirbase.revocation,
397 &channel_info.theirbase.payment,
398 &channel_info.theirbase.htlc,
399 &channel_info.theirbase.delayed_payment,
400 &channel_info.remote_per_commit,
401 &fc->uc->minimum_depth,
402 &channel_info.remote_fundingkey,
403 &funding,
404 &feerate,
405 &fc->uc->our_config.channel_reserve,
406 &remote_upfront_shutdown_script,
407 &type)) {
408 log_broken(fc->uc->log,
409 "bad OPENING_FUNDER_REPLY %s",
410 tal_hex(resp, resp));
411 was_pending(command_fail(fc->cmd, LIGHTNINGD,
412 "bad OPENING_FUNDER_REPLY %s",
413 tal_hex(fc->cmd, resp)));
414 goto cleanup;
415 }
416 remote_commit->chainparams = chainparams;
417
418 peer_fd = new_peer_fd_arr(resp, fds);
419
420 log_debug(ld->log,
421 "%s", fmt_pubkey(tmpctx,
422 &channel_info.remote_per_commit));
423
424 /* Saved with channel to disk */
425 derive_channel_id(&cid, &funding);
426
427 /* old_remote_per_commit not valid yet, copy valid one. */

Callers 1

openingd_msgFunction · 0.85

Calls 13

tal_hexFunction · 0.85
fmt_pubkeyFunction · 0.85
derive_channel_idFunction · 0.85
channel_watch_fundingFunction · 0.85
wallet_penalty_base_addFunction · 0.85
funding_successFunction · 0.85
tal_freeFunction · 0.85
was_pendingFunction · 0.70
command_failFunction · 0.70
new_peer_fd_arrFunction · 0.70
wallet_commit_channelFunction · 0.70

Tested by

no test coverage detected