gossipd: don't crash if we have > 7000 stale short_channel_ids.

Fixes: #3269
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: gossipd crash on huge number of unknown channels.
This commit is contained in:
Rusty Russell 2019-11-19 15:00:28 +10:30
parent a3ef71b182
commit d119758b09
1 changed files with 2 additions and 0 deletions

View File

@ -358,6 +358,8 @@ static struct short_channel_id *stale_scids_remove(const tal_t *ctx,
uintmap_del(&seeker->stale_scids, scid);
tal_free(qf);
i++;
if (i == max)
break;
}
tal_resize(&scids, i);
tal_resize(query_flags, i);