openingd: Forward custommsgs to lightningd

This commit is contained in:
Christian Decker 2019-12-04 22:59:23 +01:00
parent 6232b27171
commit 3af010f200

View file

@ -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))