From df0661ce22b51f2417e583f3070d6b797565d8c0 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 6 Mar 2023 16:03:43 +1030 Subject: [PATCH] sql: fix bug where nodes table would get duplicate entries. As soon as we apply the next commit, we get a new problem: the delete code didn't work. Signed-off-by: Rusty Russell --- plugins/sql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sql.c b/plugins/sql.c index 86deda6ee..7c0f91645 100644 --- a/plugins/sql.c +++ b/plugins/sql.c @@ -850,7 +850,7 @@ static void delete_node_from_db(struct command *cmd, err = sqlite3_exec(db, tal_fmt(tmpctx, "DELETE FROM nodes" - " WHERE nodeid = '%s'", + " WHERE nodeid = X'%s'", node_id_to_hexstr(tmpctx, id)), NULL, NULL, &errmsg); if (err != SQLITE_OK)