Update outdated BOLT quotes in HTLC/closing handling.
What changed, and why it matters
This commit only updates code comments that quote the BOLT (Basis of Lightning Technology) specification. No program logic, behavior, or security checks were changed. It is a documentation/comment cleanup with no security relevance.
No security action required. Treat as routine comment/documentation maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies BOLT quotation comments in closingd, onchaind, lightningd/onchain_control, and the offers plugin. The changes reformat or correct outdated/imprecise BOLT section references and ellipses. There are no functional code changes, no altered control flow, and no modified cryptographic or HTLC handling logic.
Changed components
closingd/closingd.c commentslightningd/onchain_control.c commentsonchaind/onchaind.c commentsplugins/offers_invreq_hook.c commentsInspect captured patch +30 / −44
diff --git a/closingd/closingd.c b/closingd/closingd.c
index a42bcf3f..e3c22ece 100644
--- a/closingd/closingd.c
+++ b/closingd/closingd.c
@@ -159,10 +159,9 @@ static void send_offer(struct per_peer_state *pps,
/* BOLT #3:
*
- * ## Legacy Closing Transaction
- *...
- * Each node offering a signature... MAY eliminate its
- * own output.
+ * Each node offering a signature:
+ * ...
+ * - MAY eliminate its own output.
*/
/* (We don't do this). */
wire_sync_write(HSM_FD,
@@ -591,11 +590,12 @@ static void calc_fee_bounds(size_t expected_weight,
/* BOLT #2:
* - if it is not the funder:
- * - SHOULD set `max_fee_satoshis` to at least the `max_fee_satoshis`
- * received
- *...
- * Note that the non-funder is not paying the fee, so there is
- * no reason for it to have a maximum feerate.
+ * - SHOULD set `max_fee_satoshis` to at least the `max_fee_satoshis` received
+ */
+ /* BOLT #2:
+ *
+ * Note that the non-funder is not paying the fee, so there is no reason for it
+ * to have a maximum feerate.
*/
if (opener == REMOTE) {
*maxfee = funding;
diff --git a/lightningd/onchain_control.c b/lightningd/onchain_control.c
index 2a0fa583..b6dfc4dd 100644
--- a/lightningd/onchain_control.c
+++ b/lightningd/onchain_control.c
@@ -1606,9 +1606,8 @@ static void handle_onchaind_spend_htlc_expired(struct channel *channel,
/* BOLT #5:
*
- * ## HTLC Output Handling: Remote Commitment, Local Offers
+ * A local node:
* ...
- *
* - if the commitment transaction HTLC output has *timed out* AND NOT
* been *resolved*:
* - MUST *resolve* the output, by spending it to a convenient
diff --git a/onchaind/onchaind.c b/onchaind/onchaind.c
index 9b9beb26..63e8146e 100644
--- a/onchaind/onchaind.c
+++ b/onchaind/onchaind.c
@@ -1248,15 +1248,18 @@ static bool output_spent(struct tracked_output ***outs,
* if it's revoked: */
/* BOLT #5:
*
- * ## HTLC Output Handling: Local Commitment, Local Offers
- *...
- * - MUST extract the payment preimage from the
- * transaction input witness.
- *...
- * ## HTLC Output Handling: Remote Commitment, Local Offers
- *...
- * - MUST extract the payment preimage from the
- * HTLC-success transaction input witness.
+ * A node:
+ * - if the commitment transaction HTLC output is spent using the payment
+ * preimage, the output is considered *irrevocably resolved*:
+ * - MUST extract the payment preimage from the transaction input witness.
+ */
+ /* BOLT #5:
+ *
+ * A local node:
+ * - if the commitment transaction HTLC output is spent using the payment
+ * preimage:
+ * - MUST extract the payment preimage from the HTLC-success transaction input
+ * witness.
*/
handle_htlc_onchain_fulfill(out, tx_parts,
&htlc_outpoint);
@@ -1426,13 +1429,13 @@ static void tx_new_depth(struct tracked_output **outs,
* - otherwise:
* - if the *remote node* is NOT irrevocably committed to the HTLC:
* - MUST NOT *resolve* the output by spending it.
- *...
- * ## HTLC Output Handling: Remote Commitment, Remote Offers
- *...
+ */
+/* BOLT #5:
+ *
* A local node:
* - if it receives (or already possesses) a payment preimage for an unresolved
* HTLC output that it was offered AND for which it has committed to an
- * outgoing HTLC:
+ * outgoing HTLC:
* - MUST *resolve* the output by spending it to a convenient address.
* - otherwise:
* - if the remote node is NOT irrevocably committed to the HTLC:
@@ -1479,9 +1482,6 @@ static void handle_preimage(struct tracked_output **outs,
/* BOLT #5:
*
- *
- * ## HTLC Output Handling: Local Commitment, Remote Offers
- *...
* A local node:
* - if it receives (or already possesses) a payment preimage
* for an unresolved HTLC output that it has been offered
@@ -1515,14 +1515,11 @@ static void handle_preimage(struct tracked_output **outs,
} else {
/* BOLT #5:
*
- * ## HTLC Output Handling: Remote Commitment, Remote
- * Offers
- *...
* A local node:
* - if it receives (or already possesses) a payment
* preimage for an unresolved HTLC output that it was
* offered AND for which it has committed to an
- * outgoing HTLC:
+ * outgoing HTLC:
* - MUST *resolve* the output by spending it to a
* convenient address.
*/
@@ -1835,7 +1832,7 @@ static size_t resolve_our_htlc_ourcommit(struct tracked_output *out,
/* BOLT #5:
*
- * ## HTLC Output Handling: Local Commitment, Local Offers
+ * A node:
* ...
* - if the commitment transaction HTLC output has *timed out*
* and hasn't been *resolved*:
@@ -1939,9 +1936,8 @@ static size_t resolve_our_htlc_theircommit(struct tracked_output *out,
/* BOLT #5:
*
- * ## HTLC Output Handling: Remote Commitment, Local Offers
+ * A local node:
* ...
- *
* - if the commitment transaction HTLC output has *timed out* AND NOT
* been *resolved*:
* - MUST *resolve* the output, by spending it to a convenient
@@ -1971,21 +1967,13 @@ static size_t resolve_their_htlc(struct tracked_output *out,
/* BOLT #5:
*
- * ## HTLC Output Handling: Remote Commitment, Remote Offers
- *...
- * ### Requirements
- *...
* If not otherwise resolved, once the HTLC output has expired, it is
* considered *irrevocably resolved*.
*/
/* BOLT #5:
*
- * ## HTLC Output Handling: Local Commitment, Remote Offers
- *...
- * ### Requirements
- *...
- * If not otherwise resolved, once the HTLC output has expired, it is
+ * If it's NOT otherwise resolved, once the HTLC output has expired, it is
* considered *irrevocably resolved*.
*/
diff --git a/plugins/offers_invreq_hook.c b/plugins/offers_invreq_hook.c
index 95614072..476fff48 100644
--- a/plugins/offers_invreq_hook.c
+++ b/plugins/offers_invreq_hook.c
@@ -851,7 +851,6 @@ static struct command_result *listoffers_done(struct command *cmd,
/* BOLT #4:
*
* If it is the final recipient:
- *...
* - MUST ignore the message if the `path_id` does not match
* the blinded route it created for this purpose
*/
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.