Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use onion amount in MPP set calculation #1040

Merged
merged 2 commits into from
Nov 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions 04-onion-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,10 @@ The writer:
than or equal to twice `amount`.
- otherwise:
- MUST set `total_msat` to the amount it wishes to pay.
- MUST ensure that the total `amount_msat` of the HTLC set which arrives at the payee
is equal to or greater than `total_msat`.
- MUST NOT send another HTLC if the total `amount_msat` of the HTLC set is already greater or equal to `total_msat`.
- MUST ensure that the total `amt_to_forward` of the HTLC set which arrives
at the payee is equal to or greater than `total_msat`.
- MUST NOT send another HTLC if the total `amt_to_forward` of the HTLC set
is already greater or equal to `total_msat`.
- MUST include `payment_secret`.
- otherwise:
- MUST set `total_msat` equal to `amt_to_forward`.
Expand All @@ -308,10 +309,10 @@ The final node:
- MUST add it to the HTLC set corresponding to that `payment_hash`.
- SHOULD fail the entire HTLC set if `total_msat` is not the same for
all HTLCs in the set.
- if the total `amount_msat` of this HTLC set is equal to or greater than
`total_msat`:
- if the total `amt_to_forward` of this HTLC set is equal to or greater
than `total_msat`:
- SHOULD fulfill all HTLCs in the HTLC set
- otherwise, if the total `amount_msat` of this HTLC set is less than
- otherwise, if the total `amt_to_forward` of this HTLC set is less than
t-bast marked this conversation as resolved.
Show resolved Hide resolved
`total_msat`:
- MUST NOT fulfill any HTLCs in the HTLC set
- MUST fail all HTLCs in the HTLC set after some reasonable timeout.
Expand Down Expand Up @@ -1087,11 +1088,9 @@ An _intermediate hop_ MUST NOT, but the _final node_:
- if the `cltv_expiry` value is unreasonably near the present:
- MUST fail the HTLC.
- MUST return an `incorrect_or_unknown_payment_details` error.
- if the `outgoing_cltv_value` does NOT correspond with the `cltv_expiry` from
the final node's HTLC:
- if the `cltv_expiry` from the final node's HTLC is below `outgoing_cltv_value`:
- MUST return `final_incorrect_cltv_expiry` error.
- if the `amt_to_forward` does NOT correspond with the `incoming_htlc_amt` from the
final node's HTLC:
- if `amount_msat` from the final node's HTLC is below `amt_to_forward`:
- MUST return a `final_incorrect_htlc_amount` error.
- if it returns a `channel_update`:
- MUST set `short_channel_id` to the `short_channel_id` used by the incoming onion.
Expand Down