From 2aa833d424bcf7a76c9dd02d56702eec317f5c6b Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 5 Jul 2021 20:57:39 +0930 Subject: [PATCH] doc: fix up bolt12 quotes. The one about size needs the offers PR rebased onto the latest onion-message PR. Signed-off-by: Rusty Russell --- common/bolt12_merkle.c | 8 ++++---- lightningd/onion_message.c | 2 +- plugins/fetchinvoice.c | 6 ++---- plugins/offers.c | 2 +- plugins/offers_invreq_hook.c | 6 +----- 5 files changed, 9 insertions(+), 15 deletions(-) diff --git a/common/bolt12_merkle.c b/common/bolt12_merkle.c index 980b5ee3e..4350e42fd 100644 --- a/common/bolt12_merkle.c +++ b/common/bolt12_merkle.c @@ -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, diff --git a/lightningd/onion_message.c b/lightningd/onion_message.c index fa8bcf1a1..63269c441 100644 --- a/lightningd/onion_message.c +++ b/lightningd/onion_message.c @@ -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) diff --git a/plugins/fetchinvoice.c b/plugins/fetchinvoice.c index 62f1fc88c..12a080081 100644 --- a/plugins/fetchinvoice.c +++ b/plugins/fetchinvoice.c @@ -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"); @@ -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); @@ -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) diff --git a/plugins/offers.c b/plugins/offers.c index 9905d5a37..dad431d97 100644 --- a/plugins/offers.c +++ b/plugins/offers.c @@ -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) diff --git a/plugins/offers_invreq_hook.c b/plugins/offers_invreq_hook.c index b940bc3f9..26987478b 100644 --- a/plugins/offers_invreq_hook.c +++ b/plugins/offers_invreq_hook.c @@ -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); @@ -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)