Skip to content

Commit 83eb85c

Browse files
committed
docs: Add extra_tlvs to the htlc_accepted_hook doc
Changelog-Added: The `htlc_accepted_hook` now gets the TLV-stream attached to the HTLC passed through as `extra_tlvs` and can replace it. Signed-off-by: Peter Neuroth <[email protected]>
1 parent 9aa4840 commit 83eb85c

File tree

1 file changed

+5
-1
lines changed
  • doc/developers-guide/plugin-development

1 file changed

+5
-1
lines changed

doc/developers-guide/plugin-development/hooks.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,8 @@ The payload of the hook call has the following format:
413413
"amount_msat": 43,
414414
"cltv_expiry": 500028,
415415
"cltv_expiry_relative": 10,
416-
"payment_hash": "0000000000000000000000000000000000000000000000000000000000000000"
416+
"payment_hash": "0000000000000000000000000000000000000000000000000000000000000000",
417+
"extra_tlvs": "fdffff012afe00010001020539"
417418
},
418419
"forward_to": "0000000000000000000000000000000000000000000000000000000000000000"
419420
}
@@ -439,6 +440,7 @@ For detailed information about each field please refer to [BOLT 04 of the specif
439440
- `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.
440441
- `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.
441442
- `payment_hash` is the hash whose `payment_preimage` will unlock the funds and allow us to claim the HTLC.
443+
- `extra_tlvs` is an optional TLV-stream attached to the HTLC.
442444
- `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).
443445

444446
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
457459

458460
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.
459461

462+
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.
463+
460464
```json
461465
{
462466
"result": "fail",

0 commit comments

Comments
 (0)