MCPcopy Create free account
hub / github.com/ElementsProject/lightning / channel_err

Function channel_err

lightningd/channel.c:1337–1360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1335}
1336
1337static 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
1362void channel_fail_transient(struct channel *channel, bool disconnect, const char *fmt, ...)
1363{

Callers 1

channel_fail_transientFunction · 0.85

Calls 6

log_infoClass · 0.85
channel_set_ownerFunction · 0.85
channel_state_nameFunction · 0.70
dev_disconnect_permanentFunction · 0.70
channel_fail_permanentFunction · 0.70
force_peer_disconnectFunction · 0.70

Tested by

no test coverage detected