| 1162 | } |
| 1163 | |
| 1164 | static void delete_node_from_db(struct command *cmd, |
| 1165 | const struct node_id *id) |
| 1166 | { |
| 1167 | struct sql *sql = sql_of(cmd->plugin); |
| 1168 | int err; |
| 1169 | char *errmsg; |
| 1170 | |
| 1171 | err = sqlite3_exec(sql->db, |
| 1172 | tal_fmt(tmpctx, |
| 1173 | "DELETE FROM nodes" |
| 1174 | " WHERE nodeid = X'%s'", |
| 1175 | fmt_node_id(tmpctx, id)), |
| 1176 | NULL, NULL, &errmsg); |
| 1177 | if (err != SQLITE_OK) |
| 1178 | plugin_err(cmd->plugin, "Could not delete from nodes: %s", |
| 1179 | errmsg); |
| 1180 | } |
| 1181 | |
| 1182 | static bool extract_node_id(int gosstore_fd, size_t off, u16 type, |
| 1183 | struct node_id *id) |
no test coverage detected