| 468 | } |
| 469 | |
| 470 | static void peer_closing_notify(struct channel *channel, const u8 *msg) |
| 471 | { |
| 472 | char *message; |
| 473 | struct close_command *i; |
| 474 | enum log_level level; |
| 475 | |
| 476 | if (!fromwire_closingd_notification(msg, msg, &level, &message)) { |
| 477 | channel_internal_error(channel, "Bad closing_notify %s", |
| 478 | tal_hex(msg, msg)); |
| 479 | return; |
| 480 | } |
| 481 | |
| 482 | list_for_each(&channel->peer->ld->close_commands, i, list) { |
| 483 | if (i->channel != channel) |
| 484 | continue; |
| 485 | json_notify_fmt(i->cmd, level, "%s", message); |
| 486 | } |
| 487 | } |
| 488 | |
| 489 | static unsigned closing_msg(struct subd *sd, const u8 *msg, const int *fds UNUSED) |
| 490 | { |
no test coverage detected