Note: this deletes up to two rows, one for each direction. */
| 1020 | |
| 1021 | /* Note: this deletes up to two rows, one for each direction. */ |
| 1022 | static void delete_channel_from_db(struct command *cmd, |
| 1023 | struct short_channel_id scid) |
| 1024 | { |
| 1025 | struct sql *sql = sql_of(cmd->plugin); |
| 1026 | int err; |
| 1027 | char *errmsg; |
| 1028 | |
| 1029 | err = sqlite3_exec(sql->db, |
| 1030 | tal_fmt(tmpctx, |
| 1031 | "DELETE FROM channels" |
| 1032 | " WHERE short_channel_id = '%s'", |
| 1033 | fmt_short_channel_id(tmpctx, scid)), |
| 1034 | NULL, NULL, &errmsg); |
| 1035 | if (err != SQLITE_OK) |
| 1036 | plugin_err(cmd->plugin, "Could not delete from channels: %s", |
| 1037 | errmsg); |
| 1038 | } |
| 1039 | |
| 1040 | static struct command_result *channels_refresh(struct command *cmd, |
| 1041 | struct table_desc *td, |
no test coverage detected