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

Function channel_set_scid

lightningd/channel.c:296–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296void channel_set_scid(struct channel *channel, const struct short_channel_id *new_scid)
297{
298 struct lightningd *ld = channel->peer->ld;
299
300 /* Get rid of old one (if any) */
301 if (channel->scid != NULL) {
302 chanmap_remove(ld, channel, *channel->scid);
303 channel->scid = tal_free(channel->scid);
304 }
305
306 /* Add new one (if any) */
307 if (new_scid) {
308 channel->scid = tal_dup(channel, struct short_channel_id, new_scid);
309 chanmap_add(ld, channel, *new_scid);
310 }
311}
312
313void channel_add_old_scid(struct channel *channel,
314 struct short_channel_id old_scid)

Callers 3

funding_reorged_cbFunction · 0.70
change_scidFunction · 0.70
depthcb_update_scidFunction · 0.70

Calls 3

chanmap_removeFunction · 0.85
tal_freeFunction · 0.85
chanmap_addFunction · 0.85

Tested by

no test coverage detected