Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-changed: JSON API: `htlc_accepted` hook has `type` (currently `legacy` or `tlv`) and other fields directly inside `onion`.
Changelog-deprecated: JSON API: `htlc_accepted` hook `per_hop_v0` object deprecated, as is `short_channel_id` for the final hop.
@ -588,8 +588,7 @@ The payload of the hook call has the following format:
{
{
"onion": {
"onion": {
"payload": "",
"payload": "",
"per_hop_v0": {
"type": "legacy",
"realm": "00",
"short_channel_id": "1x2x3",
"short_channel_id": "1x2x3",
"forward_amount": "42msat",
"forward_amount": "42msat",
"outgoing_cltv_value": 500014
"outgoing_cltv_value": 500014
@ -606,18 +605,13 @@ The payload of the hook call has the following format:
}
}
```
```
The `per_hop_v0` will only be present if the per hop payload has format `0x00`
For detailed information about each field please refer to [BOLT 04 of the specification][bolt4], the following is just a brief summary:
as defined by the specification. If not present an object representing the
type-length-vale (TLV) payload will be added (pending specification). For detailed information about each field please refer to [BOLT 04 of the specification][bolt4], the following is just a brief summary:
- `onion.payload` contains the unparsed payload that was sent to us from the
- `onion.payload` contains the unparsed payload that was sent to us from the
sender of the payment.
sender of the payment.
- `onion.per_hop_v0`:
- `onion.type` is `legacy` for realm 0 payments, `tlv` for realm > 1.
- `realm` will always be `00` since that value determines that we are using
the `per_hop_v0` format.
- `short_channel_id` determines the channel that the sender is hinting
- `short_channel_id` determines the channel that the sender is hinting
should be used next (set to `0x0x0` if we are the recipient of the
should be used next. Not present if we're the final destination.
payment).
- `forward_amount` is the amount we should be forwarding to the next hop,
- `forward_amount` is the amount we should be forwarding to the next hop,
and should match the incoming funds in case we are the recipient.
and should match the incoming funds in case we are the recipient.
- `outgoing_cltv_value` determines what the CLTV value for the HTLC that we
- `outgoing_cltv_value` determines what the CLTV value for the HTLC that we