Skip to content

Commit

Permalink
common: fix endless loop in gossmap iteration.
Browse files Browse the repository at this point in the history
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: #7462
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell authored and ShahanaFarooqui committed Jul 25, 2024
1 parent 88024fa commit 15fb37f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions common/gossmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 15fb37f

Please sign in to comment.