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

Function channel_err

lightningd/channel.c:1276–1299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1274}
1275
1276static 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
1301void channel_fail_transient(struct channel *channel, bool disconnect, const char *fmt, ...)
1302{

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