Skip to content

Commit

Permalink
doc: fix up bolt12 quotes.
Browse files Browse the repository at this point in the history
The one about size needs the offers PR rebased onto the latest
onion-message PR.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Jul 5, 2021
1 parent 5e1e896 commit ba23269
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
8 changes: 4 additions & 4 deletions common/bolt12_merkle.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ void merkle_tlv(const struct tlv_field *fields, struct sha256 *merkle)
* Each form is signed using one or more TLV signature elements; TLV
* types 240 through 1000 are considered signature elements. For these
* the tag is `lightning` | `messagename` | `fieldname`, and `msg` is the
* merkle-root; `lightning` is the literal 9-byte ASCII string,
* `messagename` is the name of the TLV stream being signed (i.e. `offer`
* or `invoice`) and the `fieldname` is the TLV field containing the
* signature (e.g. `signature` or `recurrence_signature`).
* Merkle-root; `lightning` is the literal 9-byte ASCII string,
* `messagename` is the name of the TLV stream being signed (i.e. `offer`,
* `invoice_request` or `invoice`) and the `fieldname` is the TLV field
* containing the signature (e.g. `signature` or `payer_signature`).
*/
void sighash_from_merkle(const char *messagename,
const char *fieldname,
Expand Down
2 changes: 1 addition & 1 deletion lightningd/onion_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ static struct command_result *json_send_onion_message(struct command *cmd,
hops[i].rawtlv, tal_bytelen(hops[i].rawtlv));
sphinx_add_hop(sphinx_path, &hops[i].id, take(tlv_with_len));
}
/* BOLT-offers #4:
/* BOLT-onion-message #4:
* - SHOULD set `len` to 1366 or 32834.
*/
if (sphinx_path_payloads_size(sphinx_path) <= ROUTING_INFO_SIZE)
Expand Down
6 changes: 2 additions & 4 deletions plugins/fetchinvoice.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,10 +496,9 @@ static struct command_result *param_offer(struct command *cmd,

/* BOLT-offers #12:
*
* - if `node_id`, `description` or `signature` is not set:
* - if `node_id` or `description` is not set:
* - MUST NOT respond to the offer.
*/
/* Note: offer_decode checks `signature` */
if (!(*offer)->node_id)
return command_fail_badparam(cmd, name, buffer, tok,
"Offer does not contain a node_id");
Expand Down Expand Up @@ -925,7 +924,7 @@ static struct command_result *json_fetchinvoice(struct command *cmd,
sent->wait_timeout = *timeout;

/* BOLT-offers #12:
* - MUST set `offer_id` to the merkle root of the offer as described
* - MUST set `offer_id` to the Merkle root of the offer as described
* in [Signature Calculation](#signature-calculation).
*/
invreq->offer_id = tal(invreq, struct sha256);
Expand Down Expand Up @@ -1043,7 +1042,6 @@ static struct command_result *json_fetchinvoice(struct command *cmd,
/* BOLT-offers #12:
* - otherwise:
* - MUST NOT set `recurrence_counter`.
*...
* - MUST NOT set `recurrence_start`
*/
if (invreq->recurrence_counter)
Expand Down
2 changes: 1 addition & 1 deletion plugins/offers.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ static void json_add_offer(struct json_stream *js, const struct tlv_offer *offer
/* BOLT-offers #12:
* A reader of an offer:
*...
* - if `node_id`, `description` or `signature` is not set:
* - if `node_id` or `description` is not set:
* - MUST NOT respond to the offer.
*/
if (offer->description)
Expand Down
6 changes: 1 addition & 5 deletions plugins/offers_invreq_hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ static struct command_result *invreq_base_amount_simple(struct command *cmd,
* - otherwise:
* - MUST fail the request if it does not contain `amount`.
* - MUST use the request `amount` as the *base invoice amount*.
* (Note: invoice amount can be further modiifed by recurrence
* (Note: invoice amount can be further modified by recurrence
* below)
*/
err = invreq_must_have(cmd, ir, amount);
Expand Down Expand Up @@ -728,10 +728,6 @@ static struct command_result *listoffers_done(struct command *cmd,
* - if the offer had a `recurrence`:
* - MUST fail the request if there is no `recurrence_counter`
* field.
* - MUST fail the request if there is no
* `recurrence_signature` field.
* - MUST fail the request if `recurrence_signature` is not
* correct.
*/
err = invreq_must_have(cmd, ir, recurrence_counter);
if (err)
Expand Down

0 comments on commit ba23269

Please sign in to comment.