diff --git a/closingd/closingd.c b/closingd/closingd.c index 569c3ed0c..80c10adca 100644 --- a/closingd/closingd.c +++ b/closingd/closingd.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -113,6 +114,17 @@ static u8 *closing_read_peer_msg(const tal_t *ctx, handle_gossip_msg(pps, take(msg)); continue; } +#if DEVELOPER + /* Handle custommsgs */ + enum peer_wire type = fromwire_peektype(msg); + if (type % 2 == 1 && !peer_wire_is_defined(type)) { + /* The message is not part of the messages we know + * how to handle. Assume is custommsg, forward it + * to master. */ + wire_sync_write(REQ_FD, take(towire_custommsg_in(NULL, msg))); + continue; + } +#endif if (!handle_peer_gossip_or_error(pps, channel_id, false, msg)) return msg; } diff --git a/lightningd/closing_control.c b/lightningd/closing_control.c index 813d069fb..2df07d6f5 100644 --- a/lightningd/closing_control.c +++ b/lightningd/closing_control.c @@ -19,6 +19,7 @@ #include #include #include +#include static struct amount_sat calc_tx_fee(struct amount_sat sat_in, const struct bitcoin_tx *tx) @@ -163,6 +164,19 @@ static unsigned closing_msg(struct subd *sd, const u8 *msg, const int *fds UNUSE break; } + switch ((enum common_wire)t) { +#if DEVELOPER + case WIRE_CUSTOMMSG_IN: + handle_custommsg_in(sd->ld, sd->node_id, msg); + break; +#else + case WIRE_CUSTOMMSG_IN: +#endif + /* We send these. */ + case WIRE_CUSTOMMSG_OUT: + break; + } + return 0; }