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

Function channel_by_cid

lightningd/channel.c:652–672  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

650}
651
652struct channel *channel_by_cid(struct lightningd *ld,
653 const struct channel_id *cid)
654{
655 struct peer *p;
656 struct channel *channel;
657
658 list_for_each(&ld->peers, p, list) {
659 if (p->uncommitted_channel) {
660 /* We can't use this method for old, uncommitted
661 * channels; there's no "channel" struct here! */
662 if (channel_id_eq(&p->uncommitted_channel->cid, cid))
663 return NULL;
664 }
665 list_for_each(&p->channels, channel, list) {
666 if (channel_id_eq(&channel->cid, cid)) {
667 return channel;
668 }
669 }
670 }
671 return NULL;
672}
673
674struct channel *find_channel_by_id(const struct peer *peer,
675 const struct channel_id *cid)

Callers 6

json_openchannel_abortFunction · 0.85
json_openchannel_bumpFunction · 0.85
json_openchannel_signedFunction · 0.85
json_openchannel_updateFunction · 0.85
forward_htlcFunction · 0.85
param_channelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected