diff --git a/plugins/Makefile b/plugins/Makefile index 736312377..9d818e2a4 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -25,6 +25,9 @@ PLUGIN_PAY_LIB_SRC := plugins/libplugin-pay.c PLUGIN_PAY_LIB_HEADER := plugins/libplugin-pay.h PLUGIN_PAY_LIB_OBJS := $(PLUGIN_PAY_LIB_SRC:.c=.o) +PLUGIN_OFFERS_SRC := plugins/offers.c +PLUGIN_OFFERS_OBJS := $(PLUGIN_OFFERS_SRC:.c=.o) + PLUGIN_SPENDER_SRC := \ plugins/spender/fundchannel.c \ plugins/spender/main.c \ @@ -48,6 +51,11 @@ PLUGIN_ALL_SRC := \ $(PLUGIN_PAY_LIB_SRC) \ $(PLUGIN_PAY_SRC) \ $(PLUGIN_SPENDER_SRC) + +ifeq ($(EXPERIMENTAL_FEATURES),1) +PLUGIN_ALL_SRC += $(PLUGIN_OFFERS_SRC) +endif + PLUGIN_ALL_HEADER := \ $(PLUGIN_LIB_HEADER) \ $(PLUGIN_PAY_LIB_HEADER) \ @@ -62,6 +70,10 @@ PLUGINS := \ plugins/txprepare \ plugins/spenderp +ifeq ($(EXPERIMENTAL_FEATURES),1) +PLUGINS += plugins/offers +endif + # Make sure these depend on everything. ALL_C_SOURCES += $(PLUGIN_ALL_SRC) ALL_C_HEADERS += $(PLUGIN_ALL_HEADER) @@ -122,6 +134,8 @@ $(PLUGIN_KEYSEND_OBJS): $(PLUGIN_PAY_LIB_HEADER) plugins/spenderp: bitcoin/chainparams.o bitcoin/psbt.o common/psbt_open.o $(PLUGIN_SPENDER_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS) $(CCAN_OBJS) +plugins/offers: bitcoin/chainparams.o $(PLUGIN_OFFERS_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) common/bolt12.o common/bolt12_merkle.o wire/bolt12_exp_wiregen.o $(WIRE_OBJS) bitcoin/block.o common/channel_id.o bitcoin/preimage.o $(JSMN_OBJS) $(CCAN_OBJS) + $(PLUGIN_ALL_OBJS): $(PLUGIN_LIB_HEADER) # Generated from PLUGINS definition in plugins/Makefile diff --git a/plugins/offers.c b/plugins/offers.c new file mode 100644 index 000000000..4478af7dd --- /dev/null +++ b/plugins/offers.c @@ -0,0 +1,32 @@ +/* This plugin covers both sending and receiving offers */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const struct plugin_hook hooks[] = { +}; + +static void init(struct plugin *p, + const char *buf UNUSED, + const jsmntok_t *config UNUSED) +{ +} + +static const struct plugin_command commands[] = { +}; + +int main(int argc, char *argv[]) +{ + setup_locale(); + + plugin_main(argv, init, PLUGIN_RESTARTABLE, true, NULL, commands, + ARRAY_SIZE(commands), NULL, 0, hooks, ARRAY_SIZE(hooks), + NULL); +}