plugins: don't try to fetch max-locktime-blocks.
It was removed in v25.09, so this code is useless. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
|
||||
#define PREIMAGE_TLV_TYPE 5482373484
|
||||
#define KEYSEND_FEATUREBIT 55
|
||||
static unsigned int maxdelay_default;
|
||||
static struct node_id my_id;
|
||||
static u64 *accepted_extra_tlvs;
|
||||
static struct channel_hint_set *global_hints;
|
||||
@@ -140,20 +139,9 @@ static const char *init(struct command *init_cmd, const char *buf UNUSED,
|
||||
global_hints = notleak_with_children(channel_hint_set_new(init_cmd->plugin));
|
||||
|
||||
accepted_extra_tlvs = notleak(tal_arr(NULL, u64, 0));
|
||||
/* BOLT #4:
|
||||
* ## `max_htlc_cltv` Selection
|
||||
*
|
||||
* This ... value is defined as 2016 blocks, based on historical value
|
||||
* deployed by Lightning implementations.
|
||||
*/
|
||||
/* FIXME: Typo in spec for CLTV in descripton! But it breaks our spelling check, so we omit it above */
|
||||
maxdelay_default = 2016;
|
||||
/* 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:%},"
|
||||
"accept-htlc-tlv-type:{values_int:%}}}",
|
||||
JSON_SCAN(json_to_u32, &maxdelay_default),
|
||||
JSON_SCAN(jsonarr_accumulate_u64, &accepted_extra_tlvs));
|
||||
|
||||
return NULL;
|
||||
@@ -203,6 +191,13 @@ static struct command_result *json_keysend(struct command *cmd, const char *buf,
|
||||
bool *dev_use_shadow;
|
||||
struct out_req *req;
|
||||
|
||||
/* BOLT #4:
|
||||
* ## `max_htlc_cltv` Selection
|
||||
*
|
||||
* This ... value is defined as 2016 blocks, based on historical value
|
||||
* deployed by Lightning implementations.
|
||||
*/
|
||||
/* FIXME: Typo in spec for CLTV in descripton! But it breaks our spelling check, so we omit it above */
|
||||
if (!param_check(cmd, buf, params,
|
||||
p_req("destination", param_node_id, &destination),
|
||||
p_req("amount_msat", param_msat, &msat),
|
||||
@@ -210,8 +205,7 @@ static struct command_result *json_keysend(struct command *cmd, const char *buf,
|
||||
p_opt("maxfeepercent", param_millionths,
|
||||
&maxfee_pct_millionths),
|
||||
p_opt_def("retry_for", param_number, &retryfor, 60),
|
||||
p_opt_def("maxdelay", param_number, &maxdelay,
|
||||
maxdelay_default),
|
||||
p_opt_def("maxdelay", param_number, &maxdelay, 2016),
|
||||
p_opt("exemptfee", param_msat, &exemptfee),
|
||||
p_opt("extratlvs", param_extra_tlvs, &extra_fields),
|
||||
p_opt("routehints", param_routehint_array, &hints),
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
|
||||
/* Public key of this node. */
|
||||
static struct node_id my_id;
|
||||
static unsigned int maxdelay_default;
|
||||
static bool disablempp = false;
|
||||
static struct channel_hint_set *global_hints;
|
||||
|
||||
@@ -627,23 +626,8 @@ static const char *init(struct command *init_cmd,
|
||||
rpc_scan(init_cmd, "getinfo", take(json_out_obj(NULL, NULL, NULL)),
|
||||
"{id:%}", JSON_SCAN(json_to_node_id, &my_id));
|
||||
|
||||
/* BOLT #4:
|
||||
* ## `max_htlc_cltv` Selection
|
||||
*
|
||||
* This ... value is defined as 2016 blocks, based on historical value
|
||||
* deployed by Lightning implementations.
|
||||
*/
|
||||
/* FIXME: Typo in spec for CLTV in descripton! But it breaks our spelling check, so we omit it above */
|
||||
maxdelay_default = 2016;
|
||||
|
||||
global_hints = notleak_with_children(channel_hint_set_new(init_cmd->plugin));
|
||||
|
||||
/* 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:%}}}",
|
||||
JSON_SCAN(json_to_number, &maxdelay_default));
|
||||
|
||||
plugin_set_memleak_handler(init_cmd->plugin, memleak_mark_payments);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1294,6 +1278,13 @@ static struct command_result *json_pay(struct command *cmd,
|
||||
/* 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. */
|
||||
/* BOLT #4:
|
||||
* ## `max_htlc_cltv` Selection
|
||||
*
|
||||
* This ... value is defined as 2016 blocks, based on historical value
|
||||
* deployed by Lightning implementations.
|
||||
*/
|
||||
/* FIXME: Typo in spec for CLTV in descripton! But it breaks our spelling check, so we omit it above */
|
||||
if (!param_check(cmd, buf, params,
|
||||
/* FIXME: parameter should be invstring now */
|
||||
p_req("bolt11", param_invstring, &b11str),
|
||||
@@ -1305,7 +1296,7 @@ static struct command_result *json_pay(struct command *cmd,
|
||||
&maxfee_pct_millionths),
|
||||
p_opt_def("retry_for", param_number, &retryfor, 60),
|
||||
p_opt_def("maxdelay", param_number, &maxdelay,
|
||||
maxdelay_default),
|
||||
2016),
|
||||
p_opt("exemptfee", param_msat, &exemptfee),
|
||||
p_opt("localinvreqid", param_sha256, &local_invreq_id),
|
||||
p_opt("exclude", param_route_exclusion_array, &exclusions),
|
||||
|
||||
@@ -59,14 +59,6 @@ static const char *init(struct command *init_cmd,
|
||||
*/
|
||||
/* FIXME: Typo in spec for CLTV in descripton! But it breaks our spelling check, so we omit it above */
|
||||
pay_plugin->maxdelay_default = 2016;
|
||||
/* 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:%}}}",
|
||||
JSON_SCAN(json_to_number, &pay_plugin->maxdelay_default)
|
||||
);
|
||||
|
||||
pay_plugin->payment_map = tal(pay_plugin, struct payment_map);
|
||||
payment_map_init(pay_plugin->payment_map);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user