sql: fix crash on fresh node_announcment.

Missing quotes when we delete the old one!

Reported-by: Alex Myers
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-02-28 09:59:18 +10:30
committed by Alex Myers
parent 855980641c
commit f3baa3e510
2 changed files with 17 additions and 3 deletions

View File

@@ -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 = '%s'",
node_id_to_hexstr(tmpctx, id)),
NULL, NULL, &errmsg);
if (err != SQLITE_OK)