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

Function opening_fundee_finished

lightningd/opening_control.c:451–555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449}
450
451static void opening_fundee_finished(struct subd *openingd,
452 const u8 *reply,
453 const int *fds,
454 struct uncommitted_channel *uc)
455{
456 const u8 *fwd_msg;
457 struct channel_info channel_info;
458 struct bitcoin_signature remote_commit_sig;
459 struct bitcoin_tx *remote_commit;
460 struct channel_id cid;
461 struct lightningd *ld = openingd->ld;
462 struct bitcoin_outpoint funding;
463 struct amount_sat funding_sats;
464 struct amount_msat push;
465 u32 feerate;
466 u8 channel_flags;
467 struct channel *channel;
468 u8 *remote_upfront_shutdown_script, *local_upfront_shutdown_script;
469 struct peer_fd *peer_fd;
470 struct penalty_base *pbase;
471 struct channel_type *type;
472
473 log_debug(uc->log, "Got opening_fundee_finish_response");
474
475 /* This is a new channel_info.their_config, set its ID to 0 */
476 channel_info.their_config.id = 0;
477
478 peer_fd = new_peer_fd_arr(tmpctx, fds);
479 if (!fromwire_openingd_fundee(tmpctx, reply,
480 &channel_info.their_config,
481 &remote_commit,
482 &pbase,
483 &remote_commit_sig,
484 &channel_info.theirbase.revocation,
485 &channel_info.theirbase.payment,
486 &channel_info.theirbase.htlc,
487 &channel_info.theirbase.delayed_payment,
488 &channel_info.remote_per_commit,
489 &channel_info.remote_fundingkey,
490 &funding,
491 &funding_sats,
492 &push,
493 &channel_flags,
494 &feerate,
495 cast_const2(u8 **, &fwd_msg),
496 &uc->our_config.channel_reserve,
497 &local_upfront_shutdown_script,
498 &remote_upfront_shutdown_script,
499 &type)) {
500 log_broken(uc->log, "bad OPENING_FUNDEE_REPLY %s",
501 tal_hex(reply, reply));
502 uncommitted_channel_disconnect(uc, LOG_BROKEN,
503 "bad OPENING_FUNDEE_REPLY");
504 goto failed;
505 }
506
507 remote_commit->chainparams = chainparams;
508

Callers 1

openingd_msgFunction · 0.85

Calls 11

tal_hexFunction · 0.85
channel_watch_fundingFunction · 0.85
notify_channel_openedFunction · 0.85
wallet_penalty_base_addFunction · 0.85
tal_freeFunction · 0.85
new_peer_fd_arrFunction · 0.70
wallet_commit_channelFunction · 0.70
peer_start_channeldFunction · 0.70
derive_channel_idFunction · 0.50
type_to_stringClass · 0.50

Tested by

no test coverage detected