| 1290 | } |
| 1291 | |
| 1292 | void channel_internal_error(struct channel *channel, const char *fmt, ...) |
| 1293 | { |
| 1294 | va_list ap; |
| 1295 | char *why; |
| 1296 | |
| 1297 | va_start(ap, fmt); |
| 1298 | why = tal_vfmt(tmpctx, fmt, ap); |
| 1299 | va_end(ap); |
| 1300 | |
| 1301 | log_broken(channel->log, "Internal error %s: %s", |
| 1302 | channel_state_name(channel), why); |
| 1303 | |
| 1304 | channel_cleanup_commands(channel, why); |
| 1305 | |
| 1306 | /* Nothing ventured, nothing lost! */ |
| 1307 | if (channel_state_uncommitted(channel->state)) { |
| 1308 | channel_set_owner(channel, NULL); |
| 1309 | delete_channel(channel, false); |
| 1310 | return; |
| 1311 | } |
| 1312 | |
| 1313 | /* Don't expose internal error causes to remove unless doing dev */ |
| 1314 | if (channel->peer->ld->developer) |
| 1315 | channel_fail_permanent(channel, |
| 1316 | REASON_LOCAL, "Internal error: %s", why); |
| 1317 | else |
| 1318 | channel_fail_permanent(channel, REASON_LOCAL, "Internal error"); |
| 1319 | } |
| 1320 | |
| 1321 | void channel_set_billboard(struct channel *channel, bool perm, const char *str) |
| 1322 | { |
no test coverage detected