mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 22:45:27 +01:00
gossipd: when applying a new channel_update, preserve the dying flag.
We can update dying channels, though it seems weird! We accept gossip about them, we just don't propagate it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
aab283ca7e
commit
365bf2d84d
1 changed files with 10 additions and 1 deletions
|
@ -679,6 +679,7 @@ static const char *process_channel_update(const tal_t *ctx,
|
|||
const char *err;
|
||||
int dir = (channel_flags & ROUTING_FLAGS_DIRECTION);
|
||||
struct gossmap *gossmap = gossmap_manage_get_gossmap(gm);
|
||||
u64 offset;
|
||||
|
||||
chan = gossmap_find_chan(gossmap, &scid);
|
||||
if (!chan) {
|
||||
|
@ -727,7 +728,15 @@ static const char *process_channel_update(const tal_t *ctx,
|
|||
}
|
||||
|
||||
/* OK, apply the new one */
|
||||
gossip_store_add(gm->daemon->gs, update, timestamp);
|
||||
offset = gossip_store_add(gm->daemon->gs, update, timestamp);
|
||||
|
||||
/* If channel is dying, make sure update is also marked dying! */
|
||||
if (gossmap_chan_is_dying(gossmap, chan)) {
|
||||
gossip_store_set_flag(gm->daemon->gs,
|
||||
offset,
|
||||
GOSSIP_STORE_DYING_BIT,
|
||||
WIRE_CHANNEL_UPDATE);
|
||||
}
|
||||
|
||||
/* Now delete old */
|
||||
if (gossmap_chan_set(chan, dir))
|
||||
|
|
Loading…
Add table
Reference in a new issue