| 1124 | } |
| 1125 | |
| 1126 | static struct command_result *json_disconnect(struct command *cmd, |
| 1127 | const char *buf, |
| 1128 | const jsmntok_t *params) |
| 1129 | { |
| 1130 | struct node_id id; |
| 1131 | const char *err; |
| 1132 | |
| 1133 | err = json_scan(tmpctx, buf, params, |
| 1134 | "{disconnect:{id:%}}", |
| 1135 | JSON_SCAN(json_to_node_id, &id)); |
| 1136 | if (err) |
| 1137 | plugin_err(cmd->plugin, |
| 1138 | "`disconnect` notification payload did not" |
| 1139 | " scan %s: %.*s", |
| 1140 | err, json_tok_full_len(params), |
| 1141 | json_tok_full(buf, params)); |
| 1142 | |
| 1143 | plugin_log(cmd->plugin, LOG_DBG, |
| 1144 | "Cleaning up inflights for peer id %s", |
| 1145 | fmt_node_id(tmpctx, &id)); |
| 1146 | |
| 1147 | cleanup_peer_pending_opens(cmd, &id); |
| 1148 | |
| 1149 | return notification_handled(cmd); |
| 1150 | } |
| 1151 | |
| 1152 | static struct command_result * |
| 1153 | delete_channel_from_datastore(struct command *cmd, |
nothing calls this directly
no test coverage detected