From 15fb37f6d13541652318b694971ff2c582a07996 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 25 Jul 2024 06:45:19 +0930 Subject: [PATCH] common: fix endless loop in gossmap iteration. If we need to iterate forward to find a timestamp (only happens if we have gossip older than 2 hours), we didn't exit the loop, as it didn't actually move the offset. Fixes: https://github.com/ElementsProject/lightning/issues/7462 Signed-off-by: Rusty Russell --- common/gossmap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/gossmap.c b/common/gossmap.c index da92b4d6b..ac88d3152 100644 --- a/common/gossmap.c +++ b/common/gossmap.c @@ -1634,6 +1634,8 @@ void gossmap_iter_fast_forward(const struct gossmap *map, if (be32_to_cpu(ghdr.timestamp) >= timestamp) break; + + iter->offset += be16_to_cpu(ghdr.len) + sizeof(ghdr); } }