| 1274 | } |
| 1275 | |
| 1276 | static void channel_err(struct channel *channel, bool disconnect, const char *why) |
| 1277 | { |
| 1278 | /* Nothing to do if channel isn't actually owned! */ |
| 1279 | if (!channel->owner) |
| 1280 | return; |
| 1281 | |
| 1282 | log_info(channel->log, "Peer transient failure in %s: %s", |
| 1283 | channel_state_name(channel), why); |
| 1284 | |
| 1285 | if (dev_disconnect_permanent(channel->peer->ld)) { |
| 1286 | channel_fail_permanent(channel, |
| 1287 | REASON_LOCAL, |
| 1288 | "dev_disconnect permfail"); |
| 1289 | return; |
| 1290 | } |
| 1291 | |
| 1292 | channel_set_owner(channel, NULL); |
| 1293 | |
| 1294 | /* Force a disconnect in case the issue is with TCP */ |
| 1295 | if (disconnect) { |
| 1296 | force_peer_disconnect(channel->peer->ld, channel->peer, |
| 1297 | "One channel had an error"); |
| 1298 | } |
| 1299 | } |
| 1300 | |
| 1301 | void channel_fail_transient(struct channel *channel, bool disconnect, const char *fmt, ...) |
| 1302 | { |
no test coverage detected