| 1229 | } |
| 1230 | |
| 1231 | void channel_internal_error(struct channel *channel, const char *fmt, ...) |
| 1232 | { |
| 1233 | va_list ap; |
| 1234 | char *why; |
| 1235 | |
| 1236 | va_start(ap, fmt); |
| 1237 | why = tal_vfmt(tmpctx, fmt, ap); |
| 1238 | va_end(ap); |
| 1239 | |
| 1240 | log_broken(channel->log, "Internal error %s: %s", |
| 1241 | channel_state_name(channel), why); |
| 1242 | |
| 1243 | channel_cleanup_commands(channel, why); |
| 1244 | |
| 1245 | /* Nothing ventured, nothing lost! */ |
| 1246 | if (channel_state_uncommitted(channel->state)) { |
| 1247 | channel_set_owner(channel, NULL); |
| 1248 | delete_channel(channel, false); |
| 1249 | return; |
| 1250 | } |
| 1251 | |
| 1252 | /* Don't expose internal error causes to remove unless doing dev */ |
| 1253 | if (channel->peer->ld->developer) |
| 1254 | channel_fail_permanent(channel, |
| 1255 | REASON_LOCAL, "Internal error: %s", why); |
| 1256 | else |
| 1257 | channel_fail_permanent(channel, REASON_LOCAL, "Internal error"); |
| 1258 | } |
| 1259 | |
| 1260 | void channel_set_billboard(struct channel *channel, bool perm, const char *str) |
| 1261 | { |
no test coverage detected