diff --git a/plugins/libplugin-pay.c b/plugins/libplugin-pay.c index 948c6e9f3..6984d153f 100644 --- a/plugins/libplugin-pay.c +++ b/plugins/libplugin-pay.c @@ -984,22 +984,6 @@ void *payment_mod_get_data(const struct payment *p, abort(); } -static inline struct dummy_data * -dummy_data_init(struct payment *p) -{ - return tal(p, struct dummy_data); -} - -static inline void dummy_step_cb(struct dummy_data *dd, - struct payment *p) -{ - fprintf(stderr, "dummy_step_cb called for payment %p at step %d\n", p, p->step); - payment_continue(p); -} - -REGISTER_PAYMENT_MODIFIER(dummy, struct dummy_data *, dummy_data_init, - dummy_step_cb); - static struct retry_mod_data *retry_data_init(struct payment *p); static inline void retry_step_cb(struct retry_mod_data *rd, diff --git a/plugins/libplugin-pay.h b/plugins/libplugin-pay.h index 1520e7047..f925fe82d 100644 --- a/plugins/libplugin-pay.h +++ b/plugins/libplugin-pay.h @@ -257,16 +257,11 @@ void *payment_mod_get_data(const struct payment *payment, return payment_mod_get_data(p, &name##_pay_mod); \ } -struct dummy_data { - unsigned int *dummy_param; -}; struct retry_mod_data { int retries; }; - /* List of globally available payment modifiers. */ -extern struct payment_modifier dummy_pay_mod; REGISTER_PAYMENT_MODIFIER_HEADER(retry, struct retry_mod_data); /* For the root payment we can seed the channel_hints with the result from diff --git a/plugins/pay.c b/plugins/pay.c index 6b894eb00..a62d6cd2d 100644 --- a/plugins/pay.c +++ b/plugins/pay.c @@ -1726,8 +1726,7 @@ static void init(struct plugin *p, maxdelay_default = atoi(field); } -struct payment_modifier *paymod_mods[4] = { - &dummy_pay_mod, +struct payment_modifier *paymod_mods[3] = { &local_channel_hints_pay_mod, &retry_pay_mod, NULL, @@ -1744,16 +1743,12 @@ static struct command_result *json_paymod(struct command *cmd, const char *b11str; struct bolt11 *b11; char *fail; - struct dummy_data *ddata; p = payment_new(NULL, cmd, NULL /* No parent */, paymod_mods); - ddata = (struct dummy_data*)p->modifier_data[0]; - /* If any of the modifiers need to add params to the JSON-RPC call we * would add them to the `param()` call below, and have them be * initialized directly that way. */ if (!param(cmd, buf, params, p_req("bolt11", param_string, &b11str), - p_opt_def("dummy", param_number, &ddata->dummy_param, 42), NULL)) return command_param_failed(); diff --git a/tests/test_pay.py b/tests/test_pay.py index 4f34f3d93..f0d8427ce 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -3053,7 +3053,7 @@ def test_pay_modifiers(node_factory): # Make sure that the dummy param is in the help (and therefore assigned to # the modifier data). hlp = l1.rpc.help("paymod")['help'][0] - assert(hlp['command'] == 'paymod bolt11 [dummy]') + assert(hlp['command'] == 'paymod bolt11') inv = l2.rpc.invoice(123, 'lbl', 'desc')['bolt11'] r = l1.rpc.paymod(inv)