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 <rusty@rustcorp.com.au>
Changelog-Fixed: Plugins: `sql` nodes table now gets refreshed when gossip changes.
This commit is contained in:
Rusty Russell
2023-03-06 16:02:20 +10:30
committed by Alex Myers
parent df0661ce22
commit 1e2bc665ae

View File

@@ -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;