From 1e2bc665ae43fb423b1373806118004accebd66b Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 6 Mar 2023 16:02:20 +1030 Subject: [PATCH] sql: fix nodes table update. Without this patch, we only ever loaded the "nodes" table once, then didn't see updates. How this ever got past CI is a mystery; perhaps valgrind was so slow that the updated node_announcement hit the gossmap before we even asked sql on l3 about the nodes table? Signed-off-by: Rusty Russell Changelog-Fixed: Plugins: `sql` nodes table now gets refreshed when gossip changes. --- plugins/sql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sql.c b/plugins/sql.c index 7c0f91645..e4e61db39 100644 --- a/plugins/sql.c +++ b/plugins/sql.c @@ -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;