We only support one channel per peer anyway */
| 25 | |
| 26 | /* We only support one channel per peer anyway */ |
| 27 | static void NORETURN |
| 28 | peer_failed(struct per_peer_state *pps, |
| 29 | bool disconnect, |
| 30 | bool warn, |
| 31 | const struct channel_id *channel_id, |
| 32 | const char *desc) |
| 33 | { |
| 34 | u8 *msg; |
| 35 | |
| 36 | if (warn) { |
| 37 | msg = towire_warningfmt(desc, channel_id, "%s", desc); |
| 38 | } else { |
| 39 | msg = towire_errorfmt(desc, channel_id, "%s", desc); |
| 40 | } |
| 41 | peer_write(pps, msg); |
| 42 | |
| 43 | /* Tell master the error so it can re-xmit. */ |
| 44 | msg = towire_status_peer_error(NULL, |
| 45 | disconnect, |
| 46 | desc, |
| 47 | warn, |
| 48 | msg); |
| 49 | peer_billboard(true, desc); |
| 50 | peer_fatal_continue(take(msg), pps); |
| 51 | } |
| 52 | |
| 53 | void peer_failed_warn(struct per_peer_state *pps, |
| 54 | const struct channel_id *channel_id, |
no test coverage detected