plugins: don't check for experimental-offers option: it's the default now.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2024-11-18 15:11:15 +10:30 committed by Vincenzo Palazzo
parent e254d91bd2
commit 46b0eb108b
6 changed files with 6 additions and 38 deletions

View File

@ -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;

View File

@ -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)),

View File

@ -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 */

View File

@ -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.

View File

@ -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); */

View File

@ -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);