wire: Add common messages that are independent of daemons

These messages may be exchanged between the master and any daemon. For now
these are just the daemons that a peer may be attached to at any time since
the first example of this is the custommsg infrastructure.
This commit is contained in:
Christian Decker
2019-11-28 19:07:52 +01:00
parent 28080b2e69
commit a8fa55d275
6 changed files with 79 additions and 2 deletions

View File

@@ -33,6 +33,7 @@
#include <lightningd/plugin_hook.h>
#include <lightningd/subd.h>
#include <openingd/gen_opening_wire.h>
#include <wire/gen_common_wire.h>
#include <wire/wire.h>
#include <wire/wire_sync.h>
@@ -922,6 +923,20 @@ static unsigned int openingd_msg(struct subd *openingd,
case WIRE_OPENING_DEV_MEMLEAK_REPLY:
break;
}
switch ((enum common_wire_type)t) {
#if DEVELOPER
case WIRE_CUSTOMMSG_IN:
/* TODO(cdecker) Add handling of custom messages. */
return 0;
#else
case WIRE_CUSTOMMSG_IN:
#endif
/* We send these. */
case WIRE_CUSTOMMSG_OUT:
break;
}
log_broken(openingd->log, "Unexpected msg %s: %s",
opening_wire_type_name(t), tal_hex(tmpctx, msg));
tal_free(openingd);