mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-13 02:58:21 +01:00
common: make gossmap ignore redundant channel_announcements.
This seems to be happening to some people, so don't panic. Unfortunately we don't have a good error callback here, so msg to stderr. Fixes: https://github.com/ElementsProject/lightning/issues/7249 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
744116e501
commit
6b91497223
1 changed files with 9 additions and 2 deletions
|
@ -458,9 +458,16 @@ static struct gossmap_chan *add_channel(struct gossmap *map,
|
||||||
map_nodeid(map, cannounce_off + plus_scid_off + 8, &node_id[0]);
|
map_nodeid(map, cannounce_off + plus_scid_off + 8, &node_id[0]);
|
||||||
map_nodeid(map, cannounce_off + plus_scid_off + 8 + PUBKEY_CMPR_LEN, &node_id[1]);
|
map_nodeid(map, cannounce_off + plus_scid_off + 8 + PUBKEY_CMPR_LEN, &node_id[1]);
|
||||||
|
|
||||||
/* We 1should not get duplicates. */
|
/* We should not get duplicates. */
|
||||||
scid.u64 = map_be64(map, cannounce_off + plus_scid_off);
|
scid.u64 = map_be64(map, cannounce_off + plus_scid_off);
|
||||||
assert(!gossmap_find_chan(map, &scid));
|
chan = gossmap_find_chan(map, &scid);
|
||||||
|
if (chan) {
|
||||||
|
/* FIXME: Report this better! */
|
||||||
|
warnx("gossmap: redundant channel_announce for %s, offsets %u and %zu!",
|
||||||
|
fmt_short_channel_id(tmpctx, scid),
|
||||||
|
chan->cann_off, cannounce_off);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* We carefully map pointers to indexes, since new_node can move them! */
|
/* We carefully map pointers to indexes, since new_node can move them! */
|
||||||
n[0] = gossmap_find_node(map, &node_id[0]);
|
n[0] = gossmap_find_node(map, &node_id[0]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue