docs: Add extra_tlvs to the htlc_accepted_hook doc
What changed, and why it matters
This commit only updates developer documentation. It adds a description of an existing feature called extra_tlvs to the htlc_accepted_hook documentation. There is no code change, no bug fix, and no security issue visible in the commit itself.
No action needed. This is a documentation update with no security relevance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit is a documentation-only change to hooks.md in the Core Lightning repository. It documents that the htlc_accepted_hook now receives an extra_tlvs field and that a plugin can return extra_tlvs to replace the TLV-stream in update_add_htlc messages for forwarded HTLCs. The change is additive documentation describing already-implemented behavior.
Changed components
doc/developers-guide/plugin-development/hooks.mdInspect captured patch +5 / −1
diff --git a/doc/developers-guide/plugin-development/hooks.md b/doc/developers-guide/plugin-development/hooks.md
index 1e1cfdbd..4dd75fe9 100644
--- a/doc/developers-guide/plugin-development/hooks.md
+++ b/doc/developers-guide/plugin-development/hooks.md
@@ -413,7 +413,8 @@ The payload of the hook call has the following format:
"amount_msat": 43,
"cltv_expiry": 500028,
"cltv_expiry_relative": 10,
- "payment_hash": "0000000000000000000000000000000000000000000000000000000000000000"
+ "payment_hash": "0000000000000000000000000000000000000000000000000000000000000000",
+ "extra_tlvs": "fdffff012afe00010001020539"
},
"forward_to": "0000000000000000000000000000000000000000000000000000000000000000"
}
@@ -439,6 +440,7 @@ For detailed information about each field please refer to [BOLT 04 of the specif
- `cltv_expiry` determines when the HTLC reverts back to the sender. `cltv_expiry` minus `outgoing_cltv_expiry` should be equal or larger than our `cltv_delta` setting.
- `cltv_expiry_relative` hints how much time we still have to claim the HTLC. It is the `cltv_expiry` minus the current `blockheight` and is passed along mainly to avoid the plugin having to look up the current blockheight.
- `payment_hash` is the hash whose `payment_preimage` will unlock the funds and allow us to claim the HTLC.
+ - `extra_tlvs` is an optional TLV-stream attached to the HTLC.
- `forward_to`: if set, the channel_id we intend to forward this to (will not be present if the short_channel_id was invalid or we were the final destination).
The hook response must have one of the following formats:
@@ -457,6 +459,8 @@ It can also replace the `onion.payload` by specifying a `payload` in the respons
It can also specify `forward_to` in the response, replacing the destination. This usually only makes sense if it wants to choose an alternate channel to the same next peer, but is useful if the `payload` is also replaced.
+Also, it can specify `extra_tlvs` in the response. This will replace the TLV-stream `update_add_htlc_tlvs` in the `update_add_htlc` message for forwarded htlcs.
+
```json
{
"result": "fail",
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.