Send warning, close connection to peer */
| 177 | |
| 178 | /* Send warning, close connection to peer */ |
| 179 | static void send_warning(struct peer *peer, const char *fmt, ...) |
| 180 | { |
| 181 | va_list ap; |
| 182 | u8 *msg; |
| 183 | |
| 184 | va_start(ap, fmt); |
| 185 | status_vfmt(LOG_UNUSUAL, &peer->id, fmt, ap); |
| 186 | va_end(ap); |
| 187 | |
| 188 | va_start(ap, fmt); |
| 189 | msg = towire_warningfmtv(NULL, NULL, fmt, ap); |
| 190 | va_end(ap); |
| 191 | |
| 192 | inject_peer_msg(peer, take(msg)); |
| 193 | |
| 194 | /* Free all the subds immediately */ |
| 195 | free_all_subds(peer); |
| 196 | disconnect_peer(peer); |
| 197 | } |
| 198 | |
| 199 | /* Kicks off write_to_peer() to look for more gossip to send from store */ |
| 200 | static void wake_gossip(struct peer *peer); |
no test coverage detected