| 308 | } |
| 309 | |
| 310 | static void peer_closing_notify(struct channel *channel, const u8 *msg) |
| 311 | { |
| 312 | char *message; |
| 313 | struct close_command *i; |
| 314 | enum log_level level; |
| 315 | |
| 316 | if (!fromwire_closingd_notification(msg, msg, &level, &message)) { |
| 317 | channel_internal_error(channel, "Bad closing_notify %s", |
| 318 | tal_hex(msg, msg)); |
| 319 | return; |
| 320 | } |
| 321 | |
| 322 | list_for_each(&channel->peer->ld->close_commands, i, list) { |
| 323 | if (i->channel != channel) |
| 324 | continue; |
| 325 | json_notify_fmt(i->cmd, level, "%s", message); |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | static unsigned closing_msg(struct subd *sd, const u8 *msg, const int *fds UNUSED) |
| 330 | { |
no test coverage detected