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