From f08447d6244f96435a3621726b02357846a8df9f Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 4 Dec 2019 16:21:31 +0100 Subject: [PATCH] subd: Allow sending common messages to subdaemons --- lightningd/subd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lightningd/subd.c b/lightningd/subd.c index 1c1779cbf..3db01522d 100644 --- a/lightningd/subd.c +++ b/lightningd/subd.c @@ -27,6 +27,7 @@ #include #include #include +#include #include static bool move_fd(int from, int to) @@ -741,9 +742,11 @@ struct subd *new_channel_subd_(struct lightningd *ld, 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(fromwire_peektype(msg_out)), "INVALID")); + assert(!strstarts(common_wire_type_name(type), "INVALID") || + !strstarts(sd->msgname(type), "INVALID")); msg_enqueue(sd->outq, msg_out); }