From 6fbfe24e3ef09a0c51e6b12181888141e8ce5147 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 1 Jun 2020 16:34:20 +0200 Subject: [PATCH] paymod: Add a COMPAT_090 flag Since we end up consolidating some of the return values for `pay` and `paystatus` and change the public interface we need to add the compatibility flag and guard the switchover behind it. --- Makefile | 2 +- plugins/pay.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6be1aa1da..3f6f5e277 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,7 @@ endif ifeq ($(COMPAT),1) # We support compatibility with pre-0.6. -COMPAT_CFLAGS=-DCOMPAT_V052=1 -DCOMPAT_V060=1 -DCOMPAT_V061=1 -DCOMPAT_V062=1 -DCOMPAT_V070=1 -DCOMPAT_V072=1 -DCOMPAT_V073=1 -DCOMPAT_V080=1 -DCOMPAT_V081=1 -DCOMPAT_V082=1 +COMPAT_CFLAGS=-DCOMPAT_V052=1 -DCOMPAT_V060=1 -DCOMPAT_V061=1 -DCOMPAT_V062=1 -DCOMPAT_V070=1 -DCOMPAT_V072=1 -DCOMPAT_V073=1 -DCOMPAT_V080=1 -DCOMPAT_V081=1 -DCOMPAT_V082=1 -DCOMPAT_V090=1 endif # Timeout shortly before the 600 second travis silence timeout diff --git a/plugins/pay.c b/plugins/pay.c index 46d07628f..d5ca0ffba 100644 --- a/plugins/pay.c +++ b/plugins/pay.c @@ -1269,6 +1269,9 @@ static struct pay_status *add_pay_status(struct pay_command *pc, return ps; } +#ifndef COMPAT_V090 +UNUSED +#endif static struct command_result *json_pay(struct command *cmd, const char *buf, const jsmntok_t *params) @@ -1705,13 +1708,15 @@ static void init(struct plugin *p, maxdelay_default = atoi(field); } -#if DEVELOPER struct payment_modifier *paymod_mods[3] = { &dummy_pay_mod, &retry_pay_mod, NULL, }; +#if !DEVELOPER +UNUSED +#endif static struct command_result *json_paymod(struct command *cmd, const char *buf, const jsmntok_t *params) @@ -1770,7 +1775,6 @@ static struct command_result *json_paymod(struct command *cmd, return command_still_pending(cmd); } -#endif static const struct plugin_command commands[] = { { "pay",