Skip to content

Commit

Permalink
lightningd: add more information should subd send wrong message.
Browse files Browse the repository at this point in the history
I saw this once, but could not track it down.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and whitslack committed Oct 21, 2022
1 parent b259598 commit 6dd85a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lightningd/subd.c
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,8 @@ 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);
}

Expand Down

0 comments on commit 6dd85a8

Please sign in to comment.