From 3af010f2000711d787d02d23ebcfb8db9434ab17 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 4 Dec 2019 22:59:23 +0100 Subject: [PATCH] openingd: Forward custommsgs to lightningd --- openingd/openingd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/openingd/openingd.c b/openingd/openingd.c index 4c86a6405..820047356 100644 --- a/openingd/openingd.c +++ b/openingd/openingd.c @@ -1282,6 +1282,18 @@ static u8 *handle_peer_in(struct state *state) if (t == WIRE_OPEN_CHANNEL) return fundee_channel(state, msg); +#if DEVELOPER + /* Handle custommsgs */ + enum wire_type type = fromwire_peektype(msg); + if (type % 2 == 1 && !wire_type_is_defined(type)) { + /* The message is not part of the messages we know how to + * handle. Assuming this is a custommsg, we just forward it to the + * master. */ + wire_sync_write(REQ_FD, take(towire_custommsg_in(NULL, msg))); + return NULL; + } +#endif + /* Handles standard cases, and legal unknown ones. */ if (handle_peer_gossip_or_error(state->pps, &state->channel_id, false, msg))