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

Function channel_err

lightningd/channel.c:1264–1287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1262}
1263
1264static 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
1289void channel_fail_transient(struct channel *channel, bool disconnect, const char *fmt, ...)
1290{

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