@@ -18,13 +18,13 @@ bool bolt12_chains_match(const struct bitcoin_blkid *chains,
1818 size_t max_num_chains ,
1919 const struct chainparams * must_be_chain )
2020{
21- /* BOLT-offers #12:
21+ /* BOLT #12:
2222 * - if the chain for the invoice is not solely bitcoin:
2323 * - MUST specify `offer_chains` the offer is valid for.
2424 * - otherwise:
25- * - MAY omit `offer_chains`, implying that bitcoin is only chain.
25+ * - SHOULD omit `offer_chains`, implying that bitcoin is only chain.
2626 */
27- /* BOLT-offers #12:
27+ /* BOLT #12:
2828 * A reader of an offer:
2929 *...
3030 * - if `offer_chains` is not set:
@@ -194,7 +194,7 @@ struct tlv_offer *offer_decode(const tal_t *ctx,
194194 if (* fail )
195195 return tal_free (offer );
196196
197- /* BOLT-offers #12:
197+ /* BOLT #12:
198198 * A reader of an offer:
199199 * - if the offer contains any TLV fields outside the inclusive ranges: 1 to 79 and 1000000000 to 1999999999:
200200 * - MUST NOT respond to the offer.
@@ -214,7 +214,7 @@ struct tlv_offer *offer_decode(const tal_t *ctx,
214214 return tal_free (offer );
215215 }
216216
217- /* BOLT-offers #12:
217+ /* BOLT #12:
218218 *
219219 * - if `offer_amount` is set and `offer_description` is not set:
220220 * - MUST NOT respond to the offer.
@@ -224,7 +224,7 @@ struct tlv_offer *offer_decode(const tal_t *ctx,
224224 return tal_free (offer );
225225 }
226226
227- /* BOLT-offers #12:
227+ /* BOLT #12:
228228 *
229229 * - if neither `offer_issuer_id` nor `offer_paths` are set:
230230 * - MUST NOT respond to the offer.
@@ -234,7 +234,7 @@ struct tlv_offer *offer_decode(const tal_t *ctx,
234234 return tal_free (offer );
235235 }
236236
237- /* BOLT-offers #12:
237+ /* BOLT #12:
238238 * - if `num_hops` is 0 in any `blinded_path` in `offer_paths`:
239239 * - MUST NOT respond to the offer.
240240 */
@@ -287,10 +287,10 @@ struct tlv_invoice_request *invrequest_decode(const tal_t *ctx,
287287 if (* fail )
288288 return tal_free (invrequest );
289289
290- /* BOLT-offers #12:
290+ /* BOLT #12:
291291 * The reader:
292292 *...
293- * - MUST fail the request if any non-signature TLV fields are outside the inclusive ranges: 0 to 159 and 1000000000 to 2999999999
293+ * - MUST reject the invoice request if any non-signature TLV fields are outside the inclusive ranges: 0 to 159 and 1000000000 to 2999999999
294294 */
295295 badf = any_field_outside_range (invrequest -> fields , true,
296296 0 , 159 ,
@@ -302,9 +302,9 @@ struct tlv_invoice_request *invrequest_decode(const tal_t *ctx,
302302 return tal_free (invrequest );
303303 }
304304
305- /* BOLT-offers #12:
305+ /* BOLT #12:
306306 * - if `num_hops` is 0 in any `blinded_path` in `invreq_paths`:
307- * - MUST fail the request.
307+ * - MUST reject the invoice request.
308308 */
309309 for (size_t i = 0 ; i < tal_count (invrequest -> invreq_paths ); i ++ ) {
310310 if (tal_count (invrequest -> invreq_paths [i ]-> path ) == 0 ) {
@@ -346,12 +346,11 @@ struct tlv_invoice *invoice_decode_minimal(const tal_t *ctx,
346346 return NULL ;
347347 }
348348
349- /* BOLT-offers #12:
349+ /* BOLT #12:
350350 * - if `invreq_chain` is not present:
351- * - MUST fail the request if bitcoin is not a supported chain.
352- * - otherwise:
353- * - MUST fail the request if `invreq_chain`.`chain` is not a
354- * supported chain.
351+ * - MUST reject the invoice if bitcoin is not a supported chain.
352+ * - otherwise:
353+ * - MUST reject the invoice if `invreq_chain`.`chain` is not a supported chain.
355354 * - if `invoice_features` contains unknown _odd_ bits that are non-zero:
356355 * - MUST ignore the bit.
357356 * - if `invoice_features` contains unknown _even_ bits that are non-zero:
@@ -412,7 +411,7 @@ static u64 time_change(u64 prevstart, u32 number,
412411u64 offer_period_start (u64 basetime , size_t n ,
413412 const struct recurrence * recur )
414413{
415- /* BOLT-offers- recurrence #12:
414+ /* BOLT-recurrence #12:
416415 * 1. A `time_unit` defining 0 (seconds), 1 (days), 2 (months),
417416 * 3 (years).
418417 */
@@ -437,13 +436,13 @@ void offer_period_paywindow(const struct recurrence *recurrence,
437436 u64 basetime , u64 period_idx ,
438437 u64 * start , u64 * end )
439438{
440- /* BOLT-offers- recurrence #12:
439+ /* BOLT-recurrence #12:
441440 * - if the offer contains `recurrence_paywindow`:
442441 */
443442 if (recurrence_paywindow ) {
444443 u64 pstart = offer_period_start (basetime , period_idx ,
445444 recurrence );
446- /* BOLT-offers- recurrence #12:
445+ /* BOLT-recurrence #12:
447446 * - if the offer has a `recurrence_basetime` or the
448447 * `recurrence_counter` is non-zero:
449448 * - SHOULD NOT send an `invreq` for a period prior to
@@ -461,7 +460,7 @@ void offer_period_paywindow(const struct recurrence *recurrence,
461460 && recurrence_paywindow -> seconds_after < 60 )
462461 * end = pstart + 60 ;
463462 } else {
464- /* BOLT-offers- recurrence #12:
463+ /* BOLT-recurrence #12:
465464 * - otherwise:
466465 * - SHOULD NOT send an `invreq` with
467466 * `recurrence_counter` is non-zero for a period whose
@@ -473,7 +472,7 @@ void offer_period_paywindow(const struct recurrence *recurrence,
473472 * start = offer_period_start (basetime , period_idx - 1 ,
474473 recurrence );
475474
476- /* BOLT-offers- recurrence #12:
475+ /* BOLT-recurrence #12:
477476 * - SHOULD NOT send an `invreq` for a period which
478477 * has already passed.
479478 */
@@ -502,7 +501,7 @@ struct tlv_invoice *invoice_decode(const tal_t *ctx,
502501 if (* fail )
503502 return tal_free (invoice );
504503
505- /* BOLT-offers #12:
504+ /* BOLT #12:
506505 * A reader of an invoice:
507506 * - MUST reject the invoice if `invoice_amount` is not present.
508507 * - MUST reject the invoice if `invoice_created_at` is not present.
@@ -526,15 +525,15 @@ struct tlv_invoice *invoice_decode(const tal_t *ctx,
526525 return tal_free (invoice );
527526 }
528527
529- /* BOLT-offers #12:
528+ /* BOLT #12:
530529 * - MUST reject the invoice if `invoice_paths` is not present or is
531530 * empty. */
532531 if (tal_count (invoice -> invoice_paths ) == 0 ) {
533532 * fail = tal_strdup (ctx , "missing/empty invoice_paths" );
534533 return tal_free (invoice );
535534 }
536535
537- /* BOLT-offers #12:
536+ /* BOLT #12:
538537 * - MUST reject the invoice if `num_hops` is 0 in any
539538 * `blinded_path` in `invoice_paths`.
540539 */
@@ -546,7 +545,7 @@ struct tlv_invoice *invoice_decode(const tal_t *ctx,
546545 return tal_free (invoice );
547546 }
548547
549- /* BOLT-offers #12:
548+ /* BOLT #12:
550549 * - MUST reject the invoice if `invoice_blindedpay` is not present.
551550 * - MUST reject the invoice if `invoice_blindedpay` does not contain exactly one `blinded_payinfo` per `invoice_paths`.`blinded_path`.
552551 */
@@ -565,7 +564,7 @@ u64 invoice_expiry(const struct tlv_invoice *invoice)
565564{
566565 u64 expiry ;
567566
568- /* BOLT-offers #12:
567+ /* BOLT #12:
569568 * - if `invoice_relative_expiry` is present:
570569 * - MUST reject the invoice if the current time since 1970-01-01 UTC
571570 * is greater than `invoice_created_at` plus `seconds_from_creation`.
@@ -639,7 +638,7 @@ static void calc_offer(const u8 *tlvstream, struct sha256 *id)
639638 size_t start1 , len1 , start2 , len2 ;
640639 struct sha256_ctx ctx ;
641640
642- /* BOLT-offers #12:
641+ /* BOLT #12:
643642 * A writer of an offer:
644643 * - MUST NOT set any TLV fields outside the inclusive ranges: 1 to 79 and 1000000000 to 1999999999.
645644 */
@@ -681,7 +680,7 @@ static void calc_invreq(const u8 *tlvstream, struct sha256 *id)
681680 size_t start1 , len1 , start2 , len2 ;
682681 struct sha256_ctx ctx ;
683682
684- /* BOLT-offers #12:
683+ /* BOLT #12:
685684 * The writer:
686685 *...
687686 * - MUST NOT set any non-signature TLV fields outside the inclusive ranges: 0 to 159 and 1000000000 to 2999999999
@@ -712,7 +711,7 @@ void invoice_invreq_id(const struct tlv_invoice *invoice, struct sha256 *id)
712711}
713712
714713
715- /* BOLT-offers #12:
714+ /* BOLT #12:
716715 * ## Requirements for Invoice Requests
717716 *
718717 * The writer:
@@ -744,11 +743,11 @@ struct tlv_invoice *invoice_for_invreq(const tal_t *ctx,
744743
745744 towire_tlv_invoice_request (& wire , invreq );
746745
747- /* BOLT-offers #12:
746+ /* BOLT #12:
748747 * A writer of an invoice:
749748 *...
750749 * - if the invoice is in response to an `invoice_request`:
751- * - MUST copy all non-signature fields from the `invoice_request` (including
750+ * - MUST copy all non-signature fields from the invoice request (including
752751 * unknown fields).
753752 */
754753 len1 = tlv_span (wire , 0 , 159 , & start1 );
@@ -765,7 +764,7 @@ struct tlv_invoice *invoice_for_invreq(const tal_t *ctx,
765764
766765bool is_bolt12_signature_field (u64 typenum )
767766{
768- /* BOLT-offers #12:
767+ /* BOLT #12:
769768 * Each form is signed using one or more *signature TLV elements*: TLV
770769 * types 240 through 1000 (inclusive). */
771770 return typenum >= 240 && typenum <= 1000 ;
0 commit comments