| 1035 | } |
| 1036 | |
| 1037 | static void destroy_subd(struct subd *subd) |
| 1038 | { |
| 1039 | struct peer *peer = subd->peer; |
| 1040 | size_t pos; |
| 1041 | |
| 1042 | for (pos = 0; peer->subds[pos] != subd; pos++) |
| 1043 | assert(pos < tal_count(peer->subds)); |
| 1044 | |
| 1045 | tal_arr_remove(&peer->subds, pos); |
| 1046 | |
| 1047 | /* Make sure we try to keep reading from peer (might |
| 1048 | * have been waiting for write_to_subd) */ |
| 1049 | io_wake(&peer->peer_in); |
| 1050 | |
| 1051 | /* Maybe we were last subd out? */ |
| 1052 | maybe_free_peer(peer); |
| 1053 | } |
| 1054 | |
| 1055 | static struct subd *new_subd(struct peer *peer, |
| 1056 | const struct channel_id *channel_id) |
nothing calls this directly
no test coverage detected