| 829 | } |
| 830 | |
| 831 | void connectd_activate(struct lightningd *ld) |
| 832 | { |
| 833 | void *ret; |
| 834 | const u8 *msg; |
| 835 | struct peer *peer; |
| 836 | struct channel *channel; |
| 837 | struct peer_node_id_map_iter it; |
| 838 | |
| 839 | /* Tell connectd about all aliases/scids for known peers */ |
| 840 | for (peer = peer_node_id_map_first(ld->peers, &it); |
| 841 | peer; |
| 842 | peer = peer_node_id_map_next(ld->peers, &it)) { |
| 843 | list_for_each(&peer->channels, channel, list) { |
| 844 | if (channel->alias[LOCAL]) |
| 845 | tell_connectd_scid(ld, *channel->alias[LOCAL], &peer->id); |
| 846 | if (channel->scid && |
| 847 | (channel->channel_flags & CHANNEL_FLAGS_ANNOUNCE_CHANNEL)) { |
| 848 | tell_connectd_scid(ld, *channel->scid, &peer->id); |
| 849 | } |
| 850 | } |
| 851 | } |
| 852 | |
| 853 | msg = towire_connectd_activate(NULL, ld->listen); |
| 854 | subd_req(ld->connectd, ld->connectd, take(msg), -1, 0, |
| 855 | connect_activate_done, NULL); |
| 856 | |
| 857 | /* Wait for activate_reply */ |
| 858 | ret = io_loop(NULL, NULL); |
| 859 | log_debug(ld->log, "io_loop: %s", __func__); |
| 860 | assert(ret == ld->connectd); |
| 861 | } |
| 862 | |
| 863 | static struct command_result *json_sendcustommsg(struct command *cmd, |
| 864 | const char *buffer, |
no test coverage detected