Skip to content

Commit

Permalink
patch debug-subd-bad-msg.patch
Browse files Browse the repository at this point in the history
  • Loading branch information
rustyrussell committed Jun 17, 2022
1 parent c5e2769 commit a240f2b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lightningd/subd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit a240f2b

Please sign in to comment.