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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2024-07-25 06:45:19 +09:30 committed by ShahanaFarooqui
parent 88024fa8d6
commit 15fb37f6d1

View file

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