MCPcopy Create free account
hub / github.com/ElementsProject/lightning / delete_channel_from_db

Function delete_channel_from_db

plugins/sql.c:1022–1038  ·  view source on GitHub ↗

Note: this deletes up to two rows, one for each direction. */

Source from the content-addressed store, hash-verified

1020
1021/* Note: this deletes up to two rows, one for each direction. */
1022static 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
1040static struct command_result *channels_refresh(struct command *cmd,
1041 struct table_desc *td,

Callers 1

channels_refreshFunction · 0.85

Calls 3

sql_ofFunction · 0.85
fmt_short_channel_idFunction · 0.85
plugin_errFunction · 0.70

Tested by

no test coverage detected