@@ -18,13 +18,13 @@ bool bolt12_chains_match(const struct bitcoin_blkid *chains,
18
18
size_t max_num_chains ,
19
19
const struct chainparams * must_be_chain )
20
20
{
21
- /* BOLT-offers #12:
21
+ /* BOLT #12:
22
22
* - if the chain for the invoice is not solely bitcoin:
23
23
* - MUST specify `offer_chains` the offer is valid for.
24
24
* - otherwise:
25
- * - MAY omit `offer_chains`, implying that bitcoin is only chain.
25
+ * - SHOULD omit `offer_chains`, implying that bitcoin is only chain.
26
26
*/
27
- /* BOLT-offers #12:
27
+ /* BOLT #12:
28
28
* A reader of an offer:
29
29
*...
30
30
* - if `offer_chains` is not set:
@@ -194,7 +194,7 @@ struct tlv_offer *offer_decode(const tal_t *ctx,
194
194
if (* fail )
195
195
return tal_free (offer );
196
196
197
- /* BOLT-offers #12:
197
+ /* BOLT #12:
198
198
* A reader of an offer:
199
199
* - if the offer contains any TLV fields outside the inclusive ranges: 1 to 79 and 1000000000 to 1999999999:
200
200
* - MUST NOT respond to the offer.
@@ -214,7 +214,7 @@ struct tlv_offer *offer_decode(const tal_t *ctx,
214
214
return tal_free (offer );
215
215
}
216
216
217
- /* BOLT-offers #12:
217
+ /* BOLT #12:
218
218
*
219
219
* - if `offer_amount` is set and `offer_description` is not set:
220
220
* - MUST NOT respond to the offer.
@@ -224,7 +224,7 @@ struct tlv_offer *offer_decode(const tal_t *ctx,
224
224
return tal_free (offer );
225
225
}
226
226
227
- /* BOLT-offers #12:
227
+ /* BOLT #12:
228
228
*
229
229
* - if neither `offer_issuer_id` nor `offer_paths` are set:
230
230
* - MUST NOT respond to the offer.
@@ -234,7 +234,7 @@ struct tlv_offer *offer_decode(const tal_t *ctx,
234
234
return tal_free (offer );
235
235
}
236
236
237
- /* BOLT-offers #12:
237
+ /* BOLT #12:
238
238
* - if `num_hops` is 0 in any `blinded_path` in `offer_paths`:
239
239
* - MUST NOT respond to the offer.
240
240
*/
@@ -287,10 +287,10 @@ struct tlv_invoice_request *invrequest_decode(const tal_t *ctx,
287
287
if (* fail )
288
288
return tal_free (invrequest );
289
289
290
- /* BOLT-offers #12:
290
+ /* BOLT #12:
291
291
* The reader:
292
292
*...
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
294
294
*/
295
295
badf = any_field_outside_range (invrequest -> fields , true,
296
296
0 , 159 ,
@@ -302,9 +302,9 @@ struct tlv_invoice_request *invrequest_decode(const tal_t *ctx,
302
302
return tal_free (invrequest );
303
303
}
304
304
305
- /* BOLT-offers #12:
305
+ /* BOLT #12:
306
306
* - if `num_hops` is 0 in any `blinded_path` in `invreq_paths`:
307
- * - MUST fail the request.
307
+ * - MUST reject the invoice request.
308
308
*/
309
309
for (size_t i = 0 ; i < tal_count (invrequest -> invreq_paths ); i ++ ) {
310
310
if (tal_count (invrequest -> invreq_paths [i ]-> path ) == 0 ) {
@@ -346,12 +346,11 @@ struct tlv_invoice *invoice_decode_minimal(const tal_t *ctx,
346
346
return NULL ;
347
347
}
348
348
349
- /* BOLT-offers #12:
349
+ /* BOLT #12:
350
350
* - 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.
355
354
* - if `invoice_features` contains unknown _odd_ bits that are non-zero:
356
355
* - MUST ignore the bit.
357
356
* - if `invoice_features` contains unknown _even_ bits that are non-zero:
@@ -412,7 +411,7 @@ static u64 time_change(u64 prevstart, u32 number,
412
411
u64 offer_period_start (u64 basetime , size_t n ,
413
412
const struct recurrence * recur )
414
413
{
415
- /* BOLT-offers- recurrence #12:
414
+ /* BOLT-recurrence #12:
416
415
* 1. A `time_unit` defining 0 (seconds), 1 (days), 2 (months),
417
416
* 3 (years).
418
417
*/
@@ -437,13 +436,13 @@ void offer_period_paywindow(const struct recurrence *recurrence,
437
436
u64 basetime , u64 period_idx ,
438
437
u64 * start , u64 * end )
439
438
{
440
- /* BOLT-offers- recurrence #12:
439
+ /* BOLT-recurrence #12:
441
440
* - if the offer contains `recurrence_paywindow`:
442
441
*/
443
442
if (recurrence_paywindow ) {
444
443
u64 pstart = offer_period_start (basetime , period_idx ,
445
444
recurrence );
446
- /* BOLT-offers- recurrence #12:
445
+ /* BOLT-recurrence #12:
447
446
* - if the offer has a `recurrence_basetime` or the
448
447
* `recurrence_counter` is non-zero:
449
448
* - SHOULD NOT send an `invreq` for a period prior to
@@ -461,7 +460,7 @@ void offer_period_paywindow(const struct recurrence *recurrence,
461
460
&& recurrence_paywindow -> seconds_after < 60 )
462
461
* end = pstart + 60 ;
463
462
} else {
464
- /* BOLT-offers- recurrence #12:
463
+ /* BOLT-recurrence #12:
465
464
* - otherwise:
466
465
* - SHOULD NOT send an `invreq` with
467
466
* `recurrence_counter` is non-zero for a period whose
@@ -473,7 +472,7 @@ void offer_period_paywindow(const struct recurrence *recurrence,
473
472
* start = offer_period_start (basetime , period_idx - 1 ,
474
473
recurrence );
475
474
476
- /* BOLT-offers- recurrence #12:
475
+ /* BOLT-recurrence #12:
477
476
* - SHOULD NOT send an `invreq` for a period which
478
477
* has already passed.
479
478
*/
@@ -502,7 +501,7 @@ struct tlv_invoice *invoice_decode(const tal_t *ctx,
502
501
if (* fail )
503
502
return tal_free (invoice );
504
503
505
- /* BOLT-offers #12:
504
+ /* BOLT #12:
506
505
* A reader of an invoice:
507
506
* - MUST reject the invoice if `invoice_amount` is not present.
508
507
* - MUST reject the invoice if `invoice_created_at` is not present.
@@ -526,15 +525,15 @@ struct tlv_invoice *invoice_decode(const tal_t *ctx,
526
525
return tal_free (invoice );
527
526
}
528
527
529
- /* BOLT-offers #12:
528
+ /* BOLT #12:
530
529
* - MUST reject the invoice if `invoice_paths` is not present or is
531
530
* empty. */
532
531
if (tal_count (invoice -> invoice_paths ) == 0 ) {
533
532
* fail = tal_strdup (ctx , "missing/empty invoice_paths" );
534
533
return tal_free (invoice );
535
534
}
536
535
537
- /* BOLT-offers #12:
536
+ /* BOLT #12:
538
537
* - MUST reject the invoice if `num_hops` is 0 in any
539
538
* `blinded_path` in `invoice_paths`.
540
539
*/
@@ -546,7 +545,7 @@ struct tlv_invoice *invoice_decode(const tal_t *ctx,
546
545
return tal_free (invoice );
547
546
}
548
547
549
- /* BOLT-offers #12:
548
+ /* BOLT #12:
550
549
* - MUST reject the invoice if `invoice_blindedpay` is not present.
551
550
* - MUST reject the invoice if `invoice_blindedpay` does not contain exactly one `blinded_payinfo` per `invoice_paths`.`blinded_path`.
552
551
*/
@@ -565,7 +564,7 @@ u64 invoice_expiry(const struct tlv_invoice *invoice)
565
564
{
566
565
u64 expiry ;
567
566
568
- /* BOLT-offers #12:
567
+ /* BOLT #12:
569
568
* - if `invoice_relative_expiry` is present:
570
569
* - MUST reject the invoice if the current time since 1970-01-01 UTC
571
570
* is greater than `invoice_created_at` plus `seconds_from_creation`.
@@ -639,7 +638,7 @@ static void calc_offer(const u8 *tlvstream, struct sha256 *id)
639
638
size_t start1 , len1 , start2 , len2 ;
640
639
struct sha256_ctx ctx ;
641
640
642
- /* BOLT-offers #12:
641
+ /* BOLT #12:
643
642
* A writer of an offer:
644
643
* - MUST NOT set any TLV fields outside the inclusive ranges: 1 to 79 and 1000000000 to 1999999999.
645
644
*/
@@ -681,7 +680,7 @@ static void calc_invreq(const u8 *tlvstream, struct sha256 *id)
681
680
size_t start1 , len1 , start2 , len2 ;
682
681
struct sha256_ctx ctx ;
683
682
684
- /* BOLT-offers #12:
683
+ /* BOLT #12:
685
684
* The writer:
686
685
*...
687
686
* - 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)
712
711
}
713
712
714
713
715
- /* BOLT-offers #12:
714
+ /* BOLT #12:
716
715
* ## Requirements for Invoice Requests
717
716
*
718
717
* The writer:
@@ -744,11 +743,11 @@ struct tlv_invoice *invoice_for_invreq(const tal_t *ctx,
744
743
745
744
towire_tlv_invoice_request (& wire , invreq );
746
745
747
- /* BOLT-offers #12:
746
+ /* BOLT #12:
748
747
* A writer of an invoice:
749
748
*...
750
749
* - 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
752
751
* unknown fields).
753
752
*/
754
753
len1 = tlv_span (wire , 0 , 159 , & start1 );
@@ -765,7 +764,7 @@ struct tlv_invoice *invoice_for_invreq(const tal_t *ctx,
765
764
766
765
bool is_bolt12_signature_field (u64 typenum )
767
766
{
768
- /* BOLT-offers #12:
767
+ /* BOLT #12:
769
768
* Each form is signed using one or more *signature TLV elements*: TLV
770
769
* types 240 through 1000 (inclusive). */
771
770
return typenum >= 240 && typenum <= 1000 ;
0 commit comments