Skip to content

Commit d5f66ce

Browse files
committed
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>
1 parent 95d8760 commit d5f66ce

3 files changed

Lines changed: 16 additions & 39 deletions

File tree

plugins/keysend.c

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
#define PREIMAGE_TLV_TYPE 5482373484
1717
#define KEYSEND_FEATUREBIT 55
18-
static unsigned int maxdelay_default;
1918
static struct node_id my_id;
2019
static u64 *accepted_extra_tlvs;
2120
static struct channel_hint_set *global_hints;
@@ -140,20 +139,9 @@ static const char *init(struct command *init_cmd, const char *buf UNUSED,
140139
global_hints = notleak_with_children(channel_hint_set_new(init_cmd->plugin));
141140

142141
accepted_extra_tlvs = notleak(tal_arr(NULL, u64, 0));
143-
/* BOLT #4:
144-
* ## `max_htlc_cltv` Selection
145-
*
146-
* This ... value is defined as 2016 blocks, based on historical value
147-
* deployed by Lightning implementations.
148-
*/
149-
/* FIXME: Typo in spec for CLTV in descripton! But it breaks our spelling check, so we omit it above */
150-
maxdelay_default = 2016;
151-
/* max-locktime-blocks deprecated in v24.05, but still grab it! */
152142
rpc_scan(init_cmd, "listconfigs", take(json_out_obj(NULL, NULL, NULL)),
153143
"{configs:{"
154-
"max-locktime-blocks?:{value_int:%},"
155144
"accept-htlc-tlv-type:{values_int:%}}}",
156-
JSON_SCAN(json_to_u32, &maxdelay_default),
157145
JSON_SCAN(jsonarr_accumulate_u64, &accepted_extra_tlvs));
158146

159147
return NULL;
@@ -203,15 +191,21 @@ static struct command_result *json_keysend(struct command *cmd, const char *buf,
203191
bool *dev_use_shadow;
204192
struct out_req *req;
205193

194+
/* BOLT #4:
195+
* ## `max_htlc_cltv` Selection
196+
*
197+
* This ... value is defined as 2016 blocks, based on historical value
198+
* deployed by Lightning implementations.
199+
*/
200+
/* FIXME: Typo in spec for CLTV in descripton! But it breaks our spelling check, so we omit it above */
206201
if (!param_check(cmd, buf, params,
207202
p_req("destination", param_node_id, &destination),
208203
p_req("amount_msat", param_msat, &msat),
209204
p_opt("label", param_string, &label),
210205
p_opt("maxfeepercent", param_millionths,
211206
&maxfee_pct_millionths),
212207
p_opt_def("retry_for", param_number, &retryfor, 60),
213-
p_opt_def("maxdelay", param_number, &maxdelay,
214-
maxdelay_default),
208+
p_opt_def("maxdelay", param_number, &maxdelay, 2016),
215209
p_opt("exemptfee", param_msat, &exemptfee),
216210
p_opt("extratlvs", param_extra_tlvs, &extra_fields),
217211
p_opt("routehints", param_routehint_array, &hints),

plugins/pay.c

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
/* Public key of this node. */
1717
static struct node_id my_id;
18-
static unsigned int maxdelay_default;
1918
static bool disablempp = false;
2019
static struct channel_hint_set *global_hints;
2120

@@ -627,23 +626,8 @@ static const char *init(struct command *init_cmd,
627626
rpc_scan(init_cmd, "getinfo", take(json_out_obj(NULL, NULL, NULL)),
628627
"{id:%}", JSON_SCAN(json_to_node_id, &my_id));
629628

630-
/* BOLT #4:
631-
* ## `max_htlc_cltv` Selection
632-
*
633-
* This ... value is defined as 2016 blocks, based on historical value
634-
* deployed by Lightning implementations.
635-
*/
636-
/* FIXME: Typo in spec for CLTV in descripton! But it breaks our spelling check, so we omit it above */
637-
maxdelay_default = 2016;
638-
639629
global_hints = notleak_with_children(channel_hint_set_new(init_cmd->plugin));
640630

641-
/* max-locktime-blocks deprecated in v24.05, but still grab it! */
642-
rpc_scan(init_cmd, "listconfigs", take(json_out_obj(NULL, NULL, NULL)),
643-
"{configs:"
644-
"{max-locktime-blocks?:{value_int:%}}}",
645-
JSON_SCAN(json_to_number, &maxdelay_default));
646-
647631
plugin_set_memleak_handler(init_cmd->plugin, memleak_mark_payments);
648632
return NULL;
649633
}
@@ -1294,6 +1278,13 @@ static struct command_result *json_pay(struct command *cmd,
12941278
/* If any of the modifiers need to add params to the JSON-RPC call we
12951279
* would add them to the `param()` call below, and have them be
12961280
* initialized directly that way. */
1281+
/* BOLT #4:
1282+
* ## `max_htlc_cltv` Selection
1283+
*
1284+
* This ... value is defined as 2016 blocks, based on historical value
1285+
* deployed by Lightning implementations.
1286+
*/
1287+
/* FIXME: Typo in spec for CLTV in descripton! But it breaks our spelling check, so we omit it above */
12971288
if (!param_check(cmd, buf, params,
12981289
/* FIXME: parameter should be invstring now */
12991290
p_req("bolt11", param_invstring, &b11str),
@@ -1305,7 +1296,7 @@ static struct command_result *json_pay(struct command *cmd,
13051296
&maxfee_pct_millionths),
13061297
p_opt_def("retry_for", param_number, &retryfor, 60),
13071298
p_opt_def("maxdelay", param_number, &maxdelay,
1308-
maxdelay_default),
1299+
2016),
13091300
p_opt("exemptfee", param_msat, &exemptfee),
13101301
p_opt("localinvreqid", param_sha256, &local_invreq_id),
13111302
p_opt("exclude", param_route_exclusion_array, &exclusions),

plugins/renepay/main.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,6 @@ static const char *init(struct command *init_cmd,
5959
*/
6060
/* FIXME: Typo in spec for CLTV in descripton! But it breaks our spelling check, so we omit it above */
6161
pay_plugin->maxdelay_default = 2016;
62-
/* max-locktime-blocks deprecated in v24.05, but still grab it! */
63-
rpc_scan(init_cmd, "listconfigs",
64-
take(json_out_obj(NULL, NULL, NULL)),
65-
"{configs:"
66-
"{max-locktime-blocks?:{value_int:%}}}",
67-
JSON_SCAN(json_to_number, &pay_plugin->maxdelay_default)
68-
);
69-
7062
pay_plugin->payment_map = tal(pay_plugin, struct payment_map);
7163
payment_map_init(pay_plugin->payment_map);
7264

0 commit comments

Comments
 (0)