Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sql nodes table (again) #6068

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugins/sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -880,7 +880,7 @@ static bool extract_node_id(int gosstore_fd, size_t off, u16 type,
!= sizeof(flen))
return false;

node_id_off = off + feature_len_off + 2 + flen + 4;
node_id_off = off + feature_len_off + 2 + be16_to_cpu(flen) + 4;
if (pread(gosstore_fd, id, sizeof(*id), node_id_off) != sizeof(*id))
return false;

Expand Down