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

Function routing_expire_channels

gossipd/routing.c:2118–2136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2116}
2117
2118void routing_expire_channels(struct routing_state *rstate, u32 blockheight)
2119{
2120 struct chan *chan;
2121
2122 for (size_t i = 0; i < tal_count(rstate->dying_channels); i++) {
2123 struct dying_channel *d = rstate->dying_channels + i;
2124
2125 if (blockheight < d->deadline_blockheight)
2126 continue;
2127 chan = get_channel(rstate, &d->scid);
2128 if (chan)
2129 channel_spent(rstate, chan);
2130 /* Delete dying marker itself */
2131 gossip_store_delete(rstate->gs,
2132 &d->marker, WIRE_GOSSIP_STORE_CHAN_DYING);
2133 tal_arr_remove(&rstate->dying_channels, i);
2134 i--;
2135 }
2136}
2137
2138void remember_chan_dying(struct routing_state *rstate,
2139 const struct short_channel_id *scid,

Callers 1

new_blockheightFunction · 0.85

Calls 3

get_channelFunction · 0.85
channel_spentFunction · 0.85
gossip_store_deleteFunction · 0.70

Tested by

no test coverage detected