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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-03-06 16:03:43 +10:30
committed by Alex Myers
parent 8c3baa98cf
commit df0661ce22

View File

@@ -850,7 +850,7 @@ static void delete_node_from_db(struct command *cmd,
err = sqlite3_exec(db, err = sqlite3_exec(db,
tal_fmt(tmpctx, tal_fmt(tmpctx,
"DELETE FROM nodes" "DELETE FROM nodes"
" WHERE nodeid = '%s'", " WHERE nodeid = X'%s'",
node_id_to_hexstr(tmpctx, id)), node_id_to_hexstr(tmpctx, id)),
NULL, NULL, &errmsg); NULL, NULL, &errmsg);
if (err != SQLITE_OK) if (err != SQLITE_OK)