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

BOLT 4: don't allow a "fee" for the final node. #711

Conversation

@rustyrussell
Copy link
Collaborator

rustyrussell commented Dec 3, 2019

I recently made a cut & paste bug with the protocol tests, and
paid an HTLC of amount 100M msat, but with only a 1M msat amt_to_forward
in the hop_data. To my surprise, it was accepted.

This is because we allow overpaying the routing fee (considered 0
for the final hop). This doesn't make sense for the final hop: anything
but exact equality implies a bug, or that the previous node took the
wrong amount from the payment.

Signed-off-by: Rusty Russell rusty@rustcorp.com.au

I recently made a cut & paste bug with the protocol tests, and
paid an HTLC of amount 100M msat, but with only a 1M msat `amt_to_forward`
in the hop_data.  To my surprise, it was accepted.

This is because we allow overpaying the routing fee (considered 0
for the final hop).  This doesn't make sense for the final hop: anything
but exact equality implies a bug, or that the previous node took the
wrong amount from the payment.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@t-bast

This comment has been minimized.

Copy link
Collaborator

t-bast commented Dec 3, 2019

We're also currently using <= as a receiver, but as a sender we make sure the HTLC amountMsat equals the onion's amountToForward.

Nothing blocking on our side to merge this change, ACK aabf4e6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
2 participants
You can’t perform that action at this time.