lightningd: don't complain when gossipd gives us channel_update for dying channel.

It can definitely happen (it's not dead yet):

```
2025-05-17T08:44:48.9829150Z lightningd-2 2025-05-17T08:36:43.597Z **BROKEN** 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-chan#3: gossipd gave channel_update in CGOSSIP_CHANNEL_ANNOUNCED_DYING? update=01027cf5d46590c45eb608a7e07a7b123c998ac12a655ce11004c9d9bb59f83698e8760d7b992df0dcf925f6732503de55d596aadaa35f0a8837cee58e0769172d2a06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f00006f00000100006828493f010200060000000000000000000000010000000a000000003b023380
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2025-05-17 22:37:11 +09:30
committed by Alex Myers
parent 04ba55d88b
commit b15100d03a

View File

@@ -1093,13 +1093,14 @@ void channel_gossip_update_from_gossipd(struct channel *channel,
case CGOSSIP_WAITING_FOR_USABLE:
case CGOSSIP_CHANNEL_DEAD:
case CGOSSIP_CHANNEL_UNANNOUNCED_DYING:
case CGOSSIP_CHANNEL_ANNOUNCED_DYING:
case CGOSSIP_CHANNEL_ANNOUNCED_DEAD:
/* Shouldn't happen. */
log_broken(channel->log,
"gossipd gave channel_update in %s? update=%s",
channel_gossip_state_str(channel->channel_gossip->state),
tal_hex(tmpctx, channel_update));
/* fall thru */
case CGOSSIP_CHANNEL_ANNOUNCED_DYING:
if (taken(channel_update))
tal_free(channel_update);
return;