wire: update to slight spec neating.
What changed, and why it matters
This commit is a simple renaming of a field and its comments from 'max_period' to 'max_period_index' to match a minor BOLT12 specification wording cleanup ('spec neating'). There is no functional code change, no bug fix, and no security relevance.
No action required; this is a non-functional spec-alignment rename.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff renames the TLV field ‘max_period’ to ‘max_period_index’ in the BOLT12 wire definitions and updates two code comments in plugins/fetchinvoice.c and plugins/offers_invreq_hook.c to use the new term. The actual comparison logic (period_idx > *offer_recurrence_limit) is unchanged. This is a documentation/spec-alignment change only.
Changed components
wire/bolt12_wire.csvwire/extracted_bolt12_01_recurrence.patchplugins/fetchinvoice.cplugins/offers_invreq_hook.cInspect captured patch +9 / −9
diff --git a/plugins/fetchinvoice.c b/plugins/fetchinvoice.c
index ffc7b1b2..c7013e69 100644
--- a/plugins/fetchinvoice.c
+++ b/plugins/fetchinvoice.c
@@ -723,8 +723,8 @@ static struct command_result *invreq_done(struct command *cmd,
/* BOLT-recurrence #12:
* - if `offer_recurrence_limit` is present:
- * - MUST NOT send an `invoice_request` for a period greater than
- * `max_period`
+ * - MUST NOT send an `invoice_request` for a period index greater than
+ * `max_period_index`
*/
if (sent->invreq->offer_recurrence_limit
&& period_idx > *sent->invreq->offer_recurrence_limit)
diff --git a/plugins/offers_invreq_hook.c b/plugins/offers_invreq_hook.c
index 8714cee9..5c8cb142 100644
--- a/plugins/offers_invreq_hook.c
+++ b/plugins/offers_invreq_hook.c
@@ -455,7 +455,7 @@ static struct command_result *check_period(struct command *cmd,
/* BOLT-recurrence #12:
* - if `offer_recurrence_limit` is present:
* - MUST reject the invoice request if the period index is greater than
- * `max_period`.
+ * `max_period_index`.
*/
if (ir->invreq->offer_recurrence_limit
&& period_idx > *ir->invreq->offer_recurrence_limit) {
diff --git a/wire/bolt12_wire.csv b/wire/bolt12_wire.csv
index a12243b2..c67960a9 100644
--- a/wire/bolt12_wire.csv
+++ b/wire/bolt12_wire.csv
@@ -29,7 +29,7 @@ tlvdata,offer,offer_recurrence_base,recurrence_base,recurrence_base,
tlvtype,offer,offer_recurrence_paywindow,1000000027
tlvdata,offer,offer_recurrence_paywindow,recurrence_paywindow,recurrence_paywindow,
tlvtype,offer,offer_recurrence_limit,1000000029
-tlvdata,offer,offer_recurrence_limit,max_period,tu32,
+tlvdata,offer,offer_recurrence_limit,max_period_index,tu32,
subtype,recurrence
subtypedata,recurrence,time_unit,byte,
subtypedata,recurrence,period,tu32,
@@ -72,7 +72,7 @@ tlvdata,invoice_request,offer_recurrence_base,recurrence_base,recurrence_base,
tlvtype,invoice_request,offer_recurrence_paywindow,1000000027
tlvdata,invoice_request,offer_recurrence_paywindow,recurrence_paywindow,recurrence_paywindow,
tlvtype,invoice_request,offer_recurrence_limit,1000000029
-tlvdata,invoice_request,offer_recurrence_limit,max_period,tu32,
+tlvdata,invoice_request,offer_recurrence_limit,max_period_index,tu32,
tlvtype,invoice_request,invreq_chain,80
tlvdata,invoice_request,invreq_chain,chain,chain_hash,
tlvtype,invoice_request,invreq_amount,82
@@ -134,7 +134,7 @@ tlvdata,invoice,offer_recurrence_base,recurrence_base,recurrence_base,
tlvtype,invoice,offer_recurrence_paywindow,1000000027
tlvdata,invoice,offer_recurrence_paywindow,recurrence_paywindow,recurrence_paywindow,
tlvtype,invoice,offer_recurrence_limit,1000000029
-tlvdata,invoice,offer_recurrence_limit,max_period,tu32,
+tlvdata,invoice,offer_recurrence_limit,max_period_index,tu32,
tlvtype,invoice,invreq_chain,80
tlvdata,invoice,invreq_chain,chain,chain_hash,
tlvtype,invoice,invreq_amount,82
diff --git a/wire/extracted_bolt12_01_recurrence.patch b/wire/extracted_bolt12_01_recurrence.patch
index 9ca12394..b974197d 100644
--- a/wire/extracted_bolt12_01_recurrence.patch
+++ b/wire/extracted_bolt12_01_recurrence.patch
@@ -13,7 +13,7 @@
+tlvtype,offer,offer_recurrence_paywindow,1000000027
+tlvdata,offer,offer_recurrence_paywindow,recurrence_paywindow,recurrence_paywindow,
+tlvtype,offer,offer_recurrence_limit,1000000029
-+tlvdata,offer,offer_recurrence_limit,max_period,tu32,
++tlvdata,offer,offer_recurrence_limit,max_period_index,tu32,
+subtype,recurrence
+subtypedata,recurrence,time_unit,byte,
+subtypedata,recurrence,period,tu32,
@@ -39,7 +39,7 @@
+tlvtype,invoice_request,offer_recurrence_paywindow,1000000027
+tlvdata,invoice_request,offer_recurrence_paywindow,recurrence_paywindow,recurrence_paywindow,
+tlvtype,invoice_request,offer_recurrence_limit,1000000029
-+tlvdata,invoice_request,offer_recurrence_limit,max_period,tu32,
++tlvdata,invoice_request,offer_recurrence_limit,max_period_index,tu32,
tlvtype,invoice_request,invreq_chain,80
tlvdata,invoice_request,invreq_chain,chain,chain_hash,
tlvtype,invoice_request,invreq_amount,82
@@ -80,7 +80,7 @@
+tlvtype,invoice,offer_recurrence_paywindow,1000000027
+tlvdata,invoice,offer_recurrence_paywindow,recurrence_paywindow,recurrence_paywindow,
+tlvtype,invoice,offer_recurrence_limit,1000000029
-+tlvdata,invoice,offer_recurrence_limit,max_period,tu32,
++tlvdata,invoice,offer_recurrence_limit,max_period_index,tu32,
tlvtype,invoice,invreq_chain,80
tlvdata,invoice,invreq_chain,chain,chain_hash,
tlvtype,invoice,invreq_amount,82
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.