mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
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:
parent
e254d91bd2
commit
46b0eb108b
@ -840,10 +840,6 @@ struct command_result *json_fetchinvoice(struct command *cmd,
|
|||||||
NULL))
|
NULL))
|
||||||
return command_param_failed();
|
return command_param_failed();
|
||||||
|
|
||||||
if (!offers_enabled)
|
|
||||||
return command_fail(cmd, LIGHTNINGD,
|
|
||||||
"experimental-offers not enabled");
|
|
||||||
|
|
||||||
sent->wait_timeout = *timeout;
|
sent->wait_timeout = *timeout;
|
||||||
sent->their_paths = sent->offer->offer_paths;
|
sent->their_paths = sent->offer->offer_paths;
|
||||||
if (sent->their_paths)
|
if (sent->their_paths)
|
||||||
@ -1316,10 +1312,6 @@ struct command_result *json_sendinvoice(struct command *cmd,
|
|||||||
NULL))
|
NULL))
|
||||||
return command_param_failed();
|
return command_param_failed();
|
||||||
|
|
||||||
if (!offers_enabled)
|
|
||||||
return command_fail(cmd, LIGHTNINGD,
|
|
||||||
"experimental-offers not enabled");
|
|
||||||
|
|
||||||
sent->dev_path_use_scidd = NULL;
|
sent->dev_path_use_scidd = NULL;
|
||||||
sent->dev_reply_path = NULL;
|
sent->dev_reply_path = NULL;
|
||||||
sent->their_paths = sent->invreq->offer_paths;
|
sent->their_paths = sent->invreq->offer_paths;
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
struct pubkey id;
|
struct pubkey id;
|
||||||
u32 blockheight;
|
u32 blockheight;
|
||||||
u16 cltv_final;
|
u16 cltv_final;
|
||||||
bool offers_enabled;
|
|
||||||
bool disable_connect;
|
bool disable_connect;
|
||||||
bool dev_invoice_bpath_scid;
|
bool dev_invoice_bpath_scid;
|
||||||
struct short_channel_id *dev_invoice_internal_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 blinded_path *reply_path = NULL;
|
||||||
struct secret *secret;
|
struct secret *secret;
|
||||||
|
|
||||||
if (!offers_enabled)
|
|
||||||
return command_hook_success(cmd);
|
|
||||||
|
|
||||||
om = json_get_member(buf, params, "onion_message");
|
om = json_get_member(buf, params, "onion_message");
|
||||||
secrettok = json_get_member(buf, om, "pathsecret");
|
secrettok = json_get_member(buf, om, "pathsecret");
|
||||||
if (secrettok) {
|
if (secrettok) {
|
||||||
@ -1409,10 +1405,8 @@ static const char *init(struct command *init_cmd,
|
|||||||
rpc_scan(init_cmd, "listconfigs",
|
rpc_scan(init_cmd, "listconfigs",
|
||||||
take(json_out_obj(NULL, NULL, NULL)),
|
take(json_out_obj(NULL, NULL, NULL)),
|
||||||
"{configs:"
|
"{configs:"
|
||||||
"{cltv-final:{value_int:%},"
|
"{cltv-final:{value_int:%}}}",
|
||||||
"experimental-offers:{set:%}}}",
|
JSON_SCAN(json_to_u16, &cltv_final));
|
||||||
JSON_SCAN(json_to_u16, &cltv_final),
|
|
||||||
JSON_SCAN(json_to_bool, &offers_enabled));
|
|
||||||
|
|
||||||
rpc_scan(init_cmd, "makesecret",
|
rpc_scan(init_cmd, "makesecret",
|
||||||
take(json_out_obj(NULL, "string", BOLT12_ID_BASE_STRING)),
|
take(json_out_obj(NULL, "string", BOLT12_ID_BASE_STRING)),
|
||||||
|
@ -9,8 +9,6 @@ struct plugin;
|
|||||||
|
|
||||||
/* This is me. */
|
/* This is me. */
|
||||||
extern struct pubkey id;
|
extern struct pubkey id;
|
||||||
/* Are offers enabled? */
|
|
||||||
extern bool offers_enabled;
|
|
||||||
/* --fetchinvoice-noconnect */
|
/* --fetchinvoice-noconnect */
|
||||||
extern bool disable_connect;
|
extern bool disable_connect;
|
||||||
/* --cltv-final */
|
/* --cltv-final */
|
||||||
|
@ -470,10 +470,6 @@ struct command_result *json_offer(struct command *cmd,
|
|||||||
NULL))
|
NULL))
|
||||||
return command_param_failed();
|
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. */
|
/* Doesn't make sense to have max quantity 1. */
|
||||||
if (offer->offer_quantity_max && *offer->offer_quantity_max == 1)
|
if (offer->offer_quantity_max && *offer->offer_quantity_max == 1)
|
||||||
return command_fail_badparam(cmd, "quantity_max",
|
return command_fail_badparam(cmd, "quantity_max",
|
||||||
@ -680,10 +676,6 @@ struct command_result *json_invoicerequest(struct command *cmd,
|
|||||||
NULL))
|
NULL))
|
||||||
return command_param_failed();
|
return command_param_failed();
|
||||||
|
|
||||||
if (!offers_enabled)
|
|
||||||
return command_fail(cmd, LIGHTNINGD,
|
|
||||||
"experimental-offers not enabled");
|
|
||||||
|
|
||||||
/* BOLT-offers #12:
|
/* BOLT-offers #12:
|
||||||
* - otherwise (not responding to an offer):
|
* - otherwise (not responding to an offer):
|
||||||
* - MUST set `offer_description` to a complete description of the purpose of the payment.
|
* - MUST set `offer_description` to a complete description of the purpose of the payment.
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
/* Public key of this node. */
|
/* Public key of this node. */
|
||||||
static struct node_id my_id;
|
static struct node_id my_id;
|
||||||
static unsigned int maxdelay_default;
|
static unsigned int maxdelay_default;
|
||||||
static bool exp_offers;
|
|
||||||
static bool disablempp = false;
|
static bool disablempp = false;
|
||||||
static struct channel_hint_set *global_hints;
|
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! */
|
/* max-locktime-blocks deprecated in v24.05, but still grab it! */
|
||||||
rpc_scan(init_cmd, "listconfigs", take(json_out_obj(NULL, NULL, NULL)),
|
rpc_scan(init_cmd, "listconfigs", take(json_out_obj(NULL, NULL, NULL)),
|
||||||
"{configs:"
|
"{configs:"
|
||||||
"{max-locktime-blocks?:{value_int:%},"
|
"{max-locktime-blocks?:{value_int:%}}}",
|
||||||
"experimental-offers:{set:%}}}",
|
JSON_SCAN(json_to_number, &maxdelay_default));
|
||||||
JSON_SCAN(json_to_number, &maxdelay_default),
|
|
||||||
JSON_SCAN(json_to_bool, &exp_offers));
|
|
||||||
|
|
||||||
plugin_set_memleak_handler(init_cmd->plugin, memleak_mark_payments);
|
plugin_set_memleak_handler(init_cmd->plugin, memleak_mark_payments);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -1373,9 +1370,6 @@ static struct command_result *json_pay(struct command *cmd,
|
|||||||
if (b12 == NULL)
|
if (b12 == NULL)
|
||||||
return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
|
return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
|
||||||
"Invalid bolt12: %s", b12_fail);
|
"Invalid bolt12: %s", b12_fail);
|
||||||
if (!exp_offers)
|
|
||||||
return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
|
|
||||||
"experimental-offers disabled");
|
|
||||||
|
|
||||||
/* FIXME: We disable MPP for now */
|
/* FIXME: We disable MPP for now */
|
||||||
/* p->features = tal_steal(p, b12->features); */
|
/* p->features = tal_steal(p, b12->features); */
|
||||||
|
@ -60,10 +60,8 @@ static const char *init(struct command *init_cmd,
|
|||||||
rpc_scan(init_cmd, "listconfigs",
|
rpc_scan(init_cmd, "listconfigs",
|
||||||
take(json_out_obj(NULL, NULL, NULL)),
|
take(json_out_obj(NULL, NULL, NULL)),
|
||||||
"{configs:"
|
"{configs:"
|
||||||
"{max-locktime-blocks?:{value_int:%},"
|
"{max-locktime-blocks?:{value_int:%}}}",
|
||||||
"experimental-offers:{set:%}}}",
|
JSON_SCAN(json_to_number, &pay_plugin->maxdelay_default)
|
||||||
JSON_SCAN(json_to_number, &pay_plugin->maxdelay_default),
|
|
||||||
JSON_SCAN(json_to_bool, &pay_plugin->exp_offers)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
pay_plugin->payment_map = tal(pay_plugin, struct payment_map);
|
pay_plugin->payment_map = tal(pay_plugin, struct payment_map);
|
||||||
|
Loading…
Reference in New Issue
Block a user