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

Function handle_splice_confirmed_signed

lightningd/channel_control.c:646–686  ·  view source on GitHub ↗

After channeld have all the signatures it sends the result to us here */

Source from the content-addressed store, hash-verified

644
645/* After channeld have all the signatures it sends the result to us here */
646static void handle_splice_confirmed_signed(struct lightningd *ld,
647 struct channel *channel,
648 const u8 *msg)
649{
650 struct splice_command *cc;
651 struct bitcoin_tx *tx;
652 struct bitcoin_txid txid;
653 struct channel_inflight *inflight;
654 u32 output_index;
655
656 if (!fromwire_channeld_splice_confirmed_signed(tmpctx, msg, &tx,
657 &output_index)) {
658
659 channel_internal_error(channel,
660 "bad splice_confirmed_signed %s",
661 tal_hex(channel, msg));
662 return;
663 }
664
665 bitcoin_txid(tx, &txid);
666 inflight = channel_inflight_find(channel, &txid);
667 if (!inflight)
668 channel_internal_error(channel, "Unable to load inflight for"
669 " splice_confirmed_signed txid %s",
670 fmt_bitcoin_txid(tmpctx, &txid));
671
672 inflight->remote_tx_sigs = true;
673 wallet_inflight_save(ld->wallet, inflight);
674
675 if (channel->state != CHANNELD_AWAITING_SPLICE) {
676 log_debug(channel->log,
677 "Would broadcast splice, but state %s"
678 " isn't CHANNELD_AWAITING_SPLICE",
679 channel_state_name(channel));
680 return;
681 }
682
683 cc = splice_command_for_chan(ld, channel);
684
685 send_splice_tx(channel, tx, cc, output_index, inflight->funding_psbt);
686}
687
688static enum watch_result splice_depth_cb(struct lightningd *ld,
689 unsigned int depth,

Callers 1

channel_msgFunction · 0.85

Calls 9

tal_hexFunction · 0.85
channel_inflight_findFunction · 0.85
fmt_bitcoin_txidFunction · 0.85
wallet_inflight_saveFunction · 0.85
splice_command_for_chanFunction · 0.85
send_splice_txFunction · 0.85
channel_internal_errorFunction · 0.70
bitcoin_txidClass · 0.70
channel_state_nameFunction · 0.70

Tested by

no test coverage detected