| 1335 | } |
| 1336 | |
| 1337 | static void channel_err(struct channel *channel, bool disconnect, const char *why) |
| 1338 | { |
| 1339 | /* Nothing to do if channel isn't actually owned! */ |
| 1340 | if (!channel->owner) |
| 1341 | return; |
| 1342 | |
| 1343 | log_info(channel->log, "Peer transient failure in %s: %s", |
| 1344 | channel_state_name(channel), why); |
| 1345 | |
| 1346 | if (dev_disconnect_permanent(channel->peer->ld)) { |
| 1347 | channel_fail_permanent(channel, |
| 1348 | REASON_LOCAL, |
| 1349 | "dev_disconnect permfail"); |
| 1350 | return; |
| 1351 | } |
| 1352 | |
| 1353 | channel_set_owner(channel, NULL); |
| 1354 | |
| 1355 | /* Force a disconnect in case the issue is with TCP */ |
| 1356 | if (disconnect) { |
| 1357 | force_peer_disconnect(channel->peer->ld, channel->peer, |
| 1358 | "One channel had an error"); |
| 1359 | } |
| 1360 | } |
| 1361 | |
| 1362 | void channel_fail_transient(struct channel *channel, bool disconnect, const char *fmt, ...) |
| 1363 | { |
no test coverage detected