~ Once we've connected out, we disable the callback which would cause us to * to try the next address. */
| 164 | /*~ Once we've connected out, we disable the callback which would cause us to |
| 165 | * to try the next address. */ |
| 166 | static void connected_out_to_peer(struct daemon *daemon, |
| 167 | struct io_conn *conn, |
| 168 | const struct node_id *id) |
| 169 | { |
| 170 | struct connecting *connect = find_connecting(daemon, id); |
| 171 | |
| 172 | /* We allocate 'conn' as a child of 'connect': we don't want to free |
| 173 | * it just yet though. tal_steal() it onto the permanent 'daemon' |
| 174 | * struct. */ |
| 175 | tal_steal(daemon, conn); |
| 176 | |
| 177 | /* We only allow one outgoing attempt at a time */ |
| 178 | assert(connect->conn == conn); |
| 179 | |
| 180 | /* Don't call destroy_io_conn, since we're done. */ |
| 181 | io_set_finish(conn, NULL, NULL); |
| 182 | |
| 183 | /* Now free the 'connecting' struct. */ |
| 184 | tal_free(connect); |
| 185 | } |
| 186 | |
| 187 | /*~ Once they've connected in, stop trying to connect out (if we were). */ |
| 188 | static void peer_connected_in(struct daemon *daemon, |
no test coverage detected