| 1262 | } |
| 1263 | |
| 1264 | static void channel_err(struct channel *channel, bool disconnect, const char *why) |
| 1265 | { |
| 1266 | /* Nothing to do if channel isn't actually owned! */ |
| 1267 | if (!channel->owner) |
| 1268 | return; |
| 1269 | |
| 1270 | log_info(channel->log, "Peer transient failure in %s: %s", |
| 1271 | channel_state_name(channel), why); |
| 1272 | |
| 1273 | if (dev_disconnect_permanent(channel->peer->ld)) { |
| 1274 | channel_fail_permanent(channel, |
| 1275 | REASON_LOCAL, |
| 1276 | "dev_disconnect permfail"); |
| 1277 | return; |
| 1278 | } |
| 1279 | |
| 1280 | channel_set_owner(channel, NULL); |
| 1281 | |
| 1282 | /* Force a disconnect in case the issue is with TCP */ |
| 1283 | if (disconnect) { |
| 1284 | force_peer_disconnect(channel->peer->ld, channel->peer, |
| 1285 | "One channel had an error"); |
| 1286 | } |
| 1287 | } |
| 1288 | |
| 1289 | void channel_fail_transient(struct channel *channel, bool disconnect, const char *fmt, ...) |
| 1290 | { |
no test coverage detected