lightningd: don't send channeld message to onchaind.

```
----------------------------- Captured stderr call -----------------------------
Sending onchaind an invalid message 03ed00000000000000004e52a9129a66619d6809b1024eb9a0159f173a988f3a5d0bdd2447b4fcc24cef
lightningd: FATAL SIGNAL 6 (version 3c57147-modded)
```

The channel state can also be `FUNDING_SPEND_SEEN` if onchaind is still
starting up.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2023-01-31 09:38:31 +10:30 committed by Vincenzo Palazzo
parent eee7ad3e1c
commit 8315c7c906

View file

@ -377,7 +377,7 @@ void fulfill_htlc(struct htlc_in *hin, const struct preimage *preimage)
return;
}
if (channel_on_chain(channel)) {
if (streq(channel->owner->name, "onchaind")) {
msg = towire_onchaind_known_preimage(hin, preimage);
} else {
struct fulfilled_htlc fulfilled_htlc;