From 46b0eb108b52bb0dbf67843bbc46bb8b0dfc062c Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 18 Nov 2024 15:11:15 +1030 Subject: [PATCH] plugins: don't check for experimental-offers option: it's the default now. Signed-off-by: Rusty Russell --- plugins/fetchinvoice.c | 8 -------- plugins/offers.c | 10 ++-------- plugins/offers.h | 2 -- plugins/offers_offer.c | 8 -------- plugins/pay.c | 10 ++-------- plugins/renepay/main.c | 6 ++---- 6 files changed, 6 insertions(+), 38 deletions(-) diff --git a/plugins/fetchinvoice.c b/plugins/fetchinvoice.c index 93fc23bab..bbc2ab669 100644 --- a/plugins/fetchinvoice.c +++ b/plugins/fetchinvoice.c @@ -840,10 +840,6 @@ struct command_result *json_fetchinvoice(struct command *cmd, NULL)) return command_param_failed(); - if (!offers_enabled) - return command_fail(cmd, LIGHTNINGD, - "experimental-offers not enabled"); - sent->wait_timeout = *timeout; sent->their_paths = sent->offer->offer_paths; if (sent->their_paths) @@ -1316,10 +1312,6 @@ struct command_result *json_sendinvoice(struct command *cmd, NULL)) return command_param_failed(); - if (!offers_enabled) - return command_fail(cmd, LIGHTNINGD, - "experimental-offers not enabled"); - sent->dev_path_use_scidd = NULL; sent->dev_reply_path = NULL; sent->their_paths = sent->invreq->offer_paths; diff --git a/plugins/offers.c b/plugins/offers.c index 3bead103f..3d2e54282 100644 --- a/plugins/offers.c +++ b/plugins/offers.c @@ -33,7 +33,6 @@ struct pubkey id; u32 blockheight; u16 cltv_final; -bool offers_enabled; bool disable_connect; bool dev_invoice_bpath_scid; struct short_channel_id *dev_invoice_internal_scid; @@ -200,9 +199,6 @@ static struct command_result *onion_message_recv(struct command *cmd, struct blinded_path *reply_path = NULL; struct secret *secret; - if (!offers_enabled) - return command_hook_success(cmd); - om = json_get_member(buf, params, "onion_message"); secrettok = json_get_member(buf, om, "pathsecret"); if (secrettok) { @@ -1409,10 +1405,8 @@ static const char *init(struct command *init_cmd, rpc_scan(init_cmd, "listconfigs", take(json_out_obj(NULL, NULL, NULL)), "{configs:" - "{cltv-final:{value_int:%}," - "experimental-offers:{set:%}}}", - JSON_SCAN(json_to_u16, &cltv_final), - JSON_SCAN(json_to_bool, &offers_enabled)); + "{cltv-final:{value_int:%}}}", + JSON_SCAN(json_to_u16, &cltv_final)); rpc_scan(init_cmd, "makesecret", take(json_out_obj(NULL, "string", BOLT12_ID_BASE_STRING)), diff --git a/plugins/offers.h b/plugins/offers.h index d689046be..6b01a33d9 100644 --- a/plugins/offers.h +++ b/plugins/offers.h @@ -9,8 +9,6 @@ struct plugin; /* This is me. */ extern struct pubkey id; -/* Are offers enabled? */ -extern bool offers_enabled; /* --fetchinvoice-noconnect */ extern bool disable_connect; /* --cltv-final */ diff --git a/plugins/offers_offer.c b/plugins/offers_offer.c index 0f84843c7..72ddcda97 100644 --- a/plugins/offers_offer.c +++ b/plugins/offers_offer.c @@ -470,10 +470,6 @@ struct command_result *json_offer(struct command *cmd, NULL)) return command_param_failed(); - if (!offers_enabled) - return command_fail(cmd, LIGHTNINGD, - "experimental-offers not enabled"); - /* Doesn't make sense to have max quantity 1. */ if (offer->offer_quantity_max && *offer->offer_quantity_max == 1) return command_fail_badparam(cmd, "quantity_max", @@ -680,10 +676,6 @@ struct command_result *json_invoicerequest(struct command *cmd, NULL)) return command_param_failed(); - if (!offers_enabled) - return command_fail(cmd, LIGHTNINGD, - "experimental-offers not enabled"); - /* BOLT-offers #12: * - otherwise (not responding to an offer): * - MUST set `offer_description` to a complete description of the purpose of the payment. diff --git a/plugins/pay.c b/plugins/pay.c index 6ef5da5ea..22d51f304 100644 --- a/plugins/pay.c +++ b/plugins/pay.c @@ -22,7 +22,6 @@ /* Public key of this node. */ static struct node_id my_id; static unsigned int maxdelay_default; -static bool exp_offers; static bool disablempp = false; static struct channel_hint_set *global_hints; @@ -648,10 +647,8 @@ static const char *init(struct command *init_cmd, /* max-locktime-blocks deprecated in v24.05, but still grab it! */ rpc_scan(init_cmd, "listconfigs", take(json_out_obj(NULL, NULL, NULL)), "{configs:" - "{max-locktime-blocks?:{value_int:%}," - "experimental-offers:{set:%}}}", - JSON_SCAN(json_to_number, &maxdelay_default), - JSON_SCAN(json_to_bool, &exp_offers)); + "{max-locktime-blocks?:{value_int:%}}}", + JSON_SCAN(json_to_number, &maxdelay_default)); plugin_set_memleak_handler(init_cmd->plugin, memleak_mark_payments); return NULL; @@ -1373,9 +1370,6 @@ static struct command_result *json_pay(struct command *cmd, if (b12 == NULL) return command_fail(cmd, JSONRPC2_INVALID_PARAMS, "Invalid bolt12: %s", b12_fail); - if (!exp_offers) - return command_fail(cmd, JSONRPC2_INVALID_PARAMS, - "experimental-offers disabled"); /* FIXME: We disable MPP for now */ /* p->features = tal_steal(p, b12->features); */ diff --git a/plugins/renepay/main.c b/plugins/renepay/main.c index fee200b2c..6b0be1c28 100644 --- a/plugins/renepay/main.c +++ b/plugins/renepay/main.c @@ -60,10 +60,8 @@ static const char *init(struct command *init_cmd, rpc_scan(init_cmd, "listconfigs", take(json_out_obj(NULL, NULL, NULL)), "{configs:" - "{max-locktime-blocks?:{value_int:%}," - "experimental-offers:{set:%}}}", - JSON_SCAN(json_to_number, &pay_plugin->maxdelay_default), - JSON_SCAN(json_to_bool, &pay_plugin->exp_offers) + "{max-locktime-blocks?:{value_int:%}}}", + JSON_SCAN(json_to_number, &pay_plugin->maxdelay_default) ); pay_plugin->payment_map = tal(pay_plugin, struct payment_map);