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

Function splice_found

lightningd/channel_control.c:730–756  ·  view source on GitHub ↗

We see this tx output spend to the splice funding address. */

Source from the content-addressed store, hash-verified

728
729/* We see this tx output spend to the splice funding address. */
730static void splice_found(struct lightningd *ld,
731 const struct bitcoin_tx *tx,
732 u32 outnum,
733 const struct txlocator *loc,
734 struct channel_inflight *inflight)
735{
736 assert(!inflight->scid);
737 inflight->scid = tal(inflight, struct short_channel_id);
738
739 if (!mk_short_channel_id(inflight->scid,
740 loc->blkheight, loc->index,
741 inflight->funding->outpoint.n)) {
742 inflight->scid = tal_free(inflight->scid);
743 channel_fail_permanent(inflight->channel,
744 REASON_LOCAL,
745 "Invalid funding scid %u:%u:%u",
746 loc->blkheight, loc->index,
747 inflight->funding->outpoint.n);
748 return;
749 }
750
751 /* We will almost immediately get called, which is what we want! */
752 watch_blockdepth(inflight, ld->topology, loc->blkheight,
753 splice_depth_cb,
754 splice_reorged_cb,
755 inflight);
756}
757
758void watch_splice_inflight(struct lightningd *ld,
759 struct channel_inflight *inflight)

Callers

nothing calls this directly

Calls 3

mk_short_channel_idFunction · 0.85
tal_freeFunction · 0.85
channel_fail_permanentFunction · 0.70

Tested by

no test coverage detected