-
Notifications
You must be signed in to change notification settings - Fork 411
Send back the actual received amount, not expected on HTLC fails #297
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
Send back the actual received amount, not expected on HTLC fails #297
Conversation
29cffba
to
571f03e
Compare
Best reviewed with -b
This shouldn't be required, but it may help prevent some downstream race conditions due to clients not sending message events quickly enough and trying to send stale messages before new channel_reestablish messages.
This is an oversight as the MessageSendEvent is otherwise entirely useless.
Sadly this requires reducing the honggfuzz iterations to fit within Travis' runtime limits.
571f03e
to
8b63892
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The comment for
fail_htlc_backwards
should be updated - An issue should be opened for the
TODO
src/ln/channelmanager.rs
Outdated
@@ -1357,17 +1359,17 @@ impl ChannelManager { | |||
/// after a PaymentReceived event. | |||
/// expected_value is the value you expected the payment to be for (not the amount it actually |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The comment for
expected_value
is no longer needed - The comment should describe what the function does instead of under what conditions it will be called
- The comment should describe what the return value represents
This resolves an incorrect implementation of the spec and fixes a major privacy leak. Fixes GH lightningdevkit#289.
8b63892
to
74588b2
Compare
Fixed the docs, thanks. We have lots of TODOs in the code, sadly we're not at the production-ready state yet where we get all of them into the issue tracker :/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
ACK 74588b2, a nit, but seems to me commit message isn't strictly right as TODO isn't implemented, just lay work for fix |
The TODO refers to HTLCs/payments with the same hash, but different values. |
Ah yes good, read too fast, think at first you were aiming to solve both fail/claim cases with this commit. TODO implies to add an expected value parameter to claim_funds function in future commit, may need to update a good chunk of things, so good for now. |
This resolves an incorrect implementation of the spec and fixes a
major privacy leak.
Fixes GH #289.