From a240f2b89e2006714850c76bf8e5bf586d49461d Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 17 Jun 2022 10:17:16 +0930 Subject: [PATCH] patch debug-subd-bad-msg.patch --- lightningd/subd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lightningd/subd.c b/lightningd/subd.c index 7dcbb0956bb0..8e5b19fcf2e0 100644 --- a/lightningd/subd.c +++ b/lightningd/subd.c @@ -834,9 +834,11 @@ struct subd *new_channel_subd_(const tal_t *ctx, void subd_send_msg(struct subd *sd, const u8 *msg_out) { u16 type = fromwire_peektype(msg_out); + /* FIXME: We should use unique upper bits for each daemon, then * have generate-wire.py add them, just assert here. */ - assert(!strstarts(sd->msgname(type), "INVALID")); + if (strstarts(sd->msgname(type), "INVALID")) + fatal("Sending %s an invalid message %s", sd->name, tal_hex(tmpctx, msg_out)); msg_enqueue(sd->outq, msg_out); }