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

Function handle_outpoints_spent

gossipd/gossipd.c:931–949  ·  view source on GitHub ↗

~ This is where lightningd tells us that a channel's funding transaction has * been spent. */

Source from the content-addressed store, hash-verified

929/*~ This is where lightningd tells us that a channel's funding transaction has
930 * been spent. */
931static void handle_outpoints_spent(struct daemon *daemon, const u8 *msg)
932{
933 struct short_channel_id *scids;
934 u32 blockheight;
935
936 if (!fromwire_gossipd_outpoints_spent(msg, msg, &blockheight, &scids))
937 master_badmsg(WIRE_GOSSIPD_OUTPOINTS_SPENT, msg);
938
939 for (size_t i = 0; i < tal_count(scids); i++) {
940 struct chan *chan = get_channel(daemon->rstate, &scids[i]);
941
942 if (!chan)
943 continue;
944
945 /* We have a current_blockheight, but it's not necessarily
946 * updated first. */
947 routing_channel_spent(daemon->rstate, blockheight, chan);
948 }
949}
950
951/*~ This is sent by lightningd when it kicks off 'closingd': we disable it
952 * in both directions.

Callers 1

recv_reqFunction · 0.85

Calls 3

get_channelFunction · 0.85
routing_channel_spentFunction · 0.85
master_badmsgFunction · 0.50

Tested by

no test coverage detected