| 650 | } |
| 651 | |
| 652 | struct 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 | |
| 674 | struct channel *find_channel_by_id(const struct peer *peer, |
| 675 | const struct channel_id *cid) |
no outgoing calls
no test coverage detected