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

Function send_splice_tx

lightningd/channel_control.c:614–643  ·  view source on GitHub ↗

Where the splice tx gets finally transmitted to the chain */

Source from the content-addressed store, hash-verified

612
613/* Where the splice tx gets finally transmitted to the chain */
614static void send_splice_tx(struct channel *channel,
615 const struct bitcoin_tx *tx,
616 struct splice_command *cc,
617 u32 output_index,
618 struct wally_psbt *psbt)
619{
620 struct lightningd *ld = channel->peer->ld;
621 u8* tx_bytes = linearize_tx(tmpctx, tx);
622
623 log_debug(channel->log,
624 "Broadcasting splice tx %s for channel %s. Final weight %zu",
625 tal_hex(tmpctx, tx_bytes),
626 fmt_channel_id(tmpctx, &channel->cid),
627 bitcoin_tx_weight(tx));
628
629 struct send_splice_info *info = tal(NULL, struct send_splice_info);
630
631 info->channel = channel;
632 info->final_tx = tal_steal(info, tx);
633 info->output_index = output_index;
634 info->err_msg = NULL;
635 info->psbt = psbt;
636
637 bitcoind_sendrawtx(ld->topology->bitcoind,
638 ld->topology->bitcoind,
639 cc ? cc->cmd->id : NULL,
640 tal_hex(tmpctx, tx_bytes),
641 false,
642 send_splice_tx_done, info);
643}
644
645/* After channeld have all the signatures it sends the result to us here */
646static void handle_splice_confirmed_signed(struct lightningd *ld,

Callers 1

Calls 4

linearize_txFunction · 0.85
tal_hexFunction · 0.85
bitcoin_tx_weightFunction · 0.85
fmt_channel_idFunction · 0.50

Tested by

no test coverage detected