| 82 | } |
| 83 | |
| 84 | static void local_mods_remove_channels(struct gossmap_localmods *mods, |
| 85 | const struct gossmap *gossmap, |
| 86 | const struct node_id *selfid, |
| 87 | const struct node_id *peerid) |
| 88 | { |
| 89 | const struct gossmap_node *peer = gossmap_find_node(gossmap, peerid); |
| 90 | const struct gossmap_node *self = gossmap_find_node(gossmap, selfid); |
| 91 | const bool enabled_off = false; |
| 92 | |
| 93 | if (!peer || !self) |
| 94 | return; |
| 95 | |
| 96 | for (size_t i = 0; i < self->num_chans; i++) { |
| 97 | int dir; |
| 98 | struct short_channel_id_dir scidd; |
| 99 | struct gossmap_chan *c = gossmap_nth_chan(gossmap, self, i, &dir); |
| 100 | |
| 101 | if (gossmap_nth_node(gossmap, c, !dir) != peer) |
| 102 | continue; |
| 103 | scidd.scid = gossmap_chan_scid(gossmap, c); |
| 104 | scidd.dir = dir; |
| 105 | |
| 106 | /* Set enabled -> false for this channel */ |
| 107 | gossmap_local_updatechan(mods, &scidd, &enabled_off, |
| 108 | NULL, NULL, NULL, NULL, NULL); |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | /* We add fake channels to gossmap to represent current outgoing connections. |
| 113 | * This allows dijkstra to find transient connections as well. */ |
no test coverage detected