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