| 161 | } |
| 162 | |
| 163 | static void free_all_subds(struct peer *peer) |
| 164 | { |
| 165 | for (size_t i = 0; i < tal_count(peer->subds); i++) { |
| 166 | /* Once conn exists, subd is a child of the conn. Free conn, free subd. */ |
| 167 | if (peer->subds[i]->conn) { |
| 168 | tal_del_destructor(peer->subds[i], destroy_connected_subd); |
| 169 | tal_free(peer->subds[i]->conn); |
| 170 | } else { |
| 171 | /* We told lightningd that peer spoke, but it hasn't returned yet. */ |
| 172 | tal_free(peer->subds[i]); |
| 173 | } |
| 174 | } |
| 175 | tal_resize(&peer->subds, 0); |
| 176 | } |
| 177 | |
| 178 | /* Send warning, close connection to peer */ |
| 179 | static void send_warning(struct peer *peer, const char *fmt, ...) |
no test coverage detected