Skip to content

Commit 46b0eb1

Browse files
rustyrussellvincenzopalazzo
authored andcommitted
plugins: don't check for experimental-offers option: it's the default now.
Signed-off-by: Rusty Russell <[email protected]>
1 parent e254d91 commit 46b0eb1

File tree

6 files changed

+6
-38
lines changed

6 files changed

+6
-38
lines changed

plugins/fetchinvoice.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -840,10 +840,6 @@ struct command_result *json_fetchinvoice(struct command *cmd,
840840
NULL))
841841
return command_param_failed();
842842

843-
if (!offers_enabled)
844-
return command_fail(cmd, LIGHTNINGD,
845-
"experimental-offers not enabled");
846-
847843
sent->wait_timeout = *timeout;
848844
sent->their_paths = sent->offer->offer_paths;
849845
if (sent->their_paths)
@@ -1316,10 +1312,6 @@ struct command_result *json_sendinvoice(struct command *cmd,
13161312
NULL))
13171313
return command_param_failed();
13181314

1319-
if (!offers_enabled)
1320-
return command_fail(cmd, LIGHTNINGD,
1321-
"experimental-offers not enabled");
1322-
13231315
sent->dev_path_use_scidd = NULL;
13241316
sent->dev_reply_path = NULL;
13251317
sent->their_paths = sent->invreq->offer_paths;

plugins/offers.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
struct pubkey id;
3434
u32 blockheight;
3535
u16 cltv_final;
36-
bool offers_enabled;
3736
bool disable_connect;
3837
bool dev_invoice_bpath_scid;
3938
struct short_channel_id *dev_invoice_internal_scid;
@@ -200,9 +199,6 @@ static struct command_result *onion_message_recv(struct command *cmd,
200199
struct blinded_path *reply_path = NULL;
201200
struct secret *secret;
202201

203-
if (!offers_enabled)
204-
return command_hook_success(cmd);
205-
206202
om = json_get_member(buf, params, "onion_message");
207203
secrettok = json_get_member(buf, om, "pathsecret");
208204
if (secrettok) {
@@ -1409,10 +1405,8 @@ static const char *init(struct command *init_cmd,
14091405
rpc_scan(init_cmd, "listconfigs",
14101406
take(json_out_obj(NULL, NULL, NULL)),
14111407
"{configs:"
1412-
"{cltv-final:{value_int:%},"
1413-
"experimental-offers:{set:%}}}",
1414-
JSON_SCAN(json_to_u16, &cltv_final),
1415-
JSON_SCAN(json_to_bool, &offers_enabled));
1408+
"{cltv-final:{value_int:%}}}",
1409+
JSON_SCAN(json_to_u16, &cltv_final));
14161410

14171411
rpc_scan(init_cmd, "makesecret",
14181412
take(json_out_obj(NULL, "string", BOLT12_ID_BASE_STRING)),

plugins/offers.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ struct plugin;
99

1010
/* This is me. */
1111
extern struct pubkey id;
12-
/* Are offers enabled? */
13-
extern bool offers_enabled;
1412
/* --fetchinvoice-noconnect */
1513
extern bool disable_connect;
1614
/* --cltv-final */

plugins/offers_offer.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -470,10 +470,6 @@ struct command_result *json_offer(struct command *cmd,
470470
NULL))
471471
return command_param_failed();
472472

473-
if (!offers_enabled)
474-
return command_fail(cmd, LIGHTNINGD,
475-
"experimental-offers not enabled");
476-
477473
/* Doesn't make sense to have max quantity 1. */
478474
if (offer->offer_quantity_max && *offer->offer_quantity_max == 1)
479475
return command_fail_badparam(cmd, "quantity_max",
@@ -680,10 +676,6 @@ struct command_result *json_invoicerequest(struct command *cmd,
680676
NULL))
681677
return command_param_failed();
682678

683-
if (!offers_enabled)
684-
return command_fail(cmd, LIGHTNINGD,
685-
"experimental-offers not enabled");
686-
687679
/* BOLT-offers #12:
688680
* - otherwise (not responding to an offer):
689681
* - MUST set `offer_description` to a complete description of the purpose of the payment.

plugins/pay.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
/* Public key of this node. */
2323
static struct node_id my_id;
2424
static unsigned int maxdelay_default;
25-
static bool exp_offers;
2625
static bool disablempp = false;
2726
static struct channel_hint_set *global_hints;
2827

@@ -648,10 +647,8 @@ static const char *init(struct command *init_cmd,
648647
/* max-locktime-blocks deprecated in v24.05, but still grab it! */
649648
rpc_scan(init_cmd, "listconfigs", take(json_out_obj(NULL, NULL, NULL)),
650649
"{configs:"
651-
"{max-locktime-blocks?:{value_int:%},"
652-
"experimental-offers:{set:%}}}",
653-
JSON_SCAN(json_to_number, &maxdelay_default),
654-
JSON_SCAN(json_to_bool, &exp_offers));
650+
"{max-locktime-blocks?:{value_int:%}}}",
651+
JSON_SCAN(json_to_number, &maxdelay_default));
655652

656653
plugin_set_memleak_handler(init_cmd->plugin, memleak_mark_payments);
657654
return NULL;
@@ -1373,9 +1370,6 @@ static struct command_result *json_pay(struct command *cmd,
13731370
if (b12 == NULL)
13741371
return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
13751372
"Invalid bolt12: %s", b12_fail);
1376-
if (!exp_offers)
1377-
return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
1378-
"experimental-offers disabled");
13791373

13801374
/* FIXME: We disable MPP for now */
13811375
/* p->features = tal_steal(p, b12->features); */

plugins/renepay/main.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,8 @@ static const char *init(struct command *init_cmd,
6060
rpc_scan(init_cmd, "listconfigs",
6161
take(json_out_obj(NULL, NULL, NULL)),
6262
"{configs:"
63-
"{max-locktime-blocks?:{value_int:%},"
64-
"experimental-offers:{set:%}}}",
65-
JSON_SCAN(json_to_number, &pay_plugin->maxdelay_default),
66-
JSON_SCAN(json_to_bool, &pay_plugin->exp_offers)
63+
"{max-locktime-blocks?:{value_int:%}}}",
64+
JSON_SCAN(json_to_number, &pay_plugin->maxdelay_default)
6765
);
6866

6967
pay_plugin->payment_map = tal(pay_plugin, struct payment_map);

0 commit comments

Comments
 (0)