| 732 | } |
| 733 | |
| 734 | static struct command_result *json_disconnect(struct command *cmd, |
| 735 | const char *buf, |
| 736 | const jsmntok_t *params) |
| 737 | { |
| 738 | struct node_id id; |
| 739 | const char *err; |
| 740 | |
| 741 | err = json_scan(tmpctx, buf, params, |
| 742 | "{id:%}", |
| 743 | JSON_SCAN(json_to_node_id, &id)); |
| 744 | if (err) |
| 745 | plugin_err(cmd->plugin, |
| 746 | "`disconnect` notification payload did not" |
| 747 | " scan %s: %.*s", |
| 748 | err, json_tok_full_len(params), |
| 749 | json_tok_full(buf, params)); |
| 750 | |
| 751 | plugin_log(cmd->plugin, LOG_DBG, |
| 752 | "Cleaning up inflights for peer id %s", |
| 753 | type_to_string(tmpctx, struct node_id, &id)); |
| 754 | |
| 755 | cleanup_peer_pending_opens(&id); |
| 756 | |
| 757 | return notification_handled(cmd); |
| 758 | } |
| 759 | |
| 760 | static struct command_result *json_channel_open_failed(struct command *cmd, |
| 761 | const char *buf, |
nothing calls this directly
no test coverage detected