-
Notifications
You must be signed in to change notification settings - Fork 374
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
Fix payment onion payload decode #1659
Fix payment onion payload decode #1659
Conversation
e9c1787
to
15074bd
Compare
(New) CI failures are due to rust-lang/libc#2866 |
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.
ACK 15074bd
LGTM! Out of curiosity: should this |
Yup, exactly! That fix was needed for #1652 (and covered by the tests added) so I stuck it in there. |
Prior to this change, we could have failed to decode a valid payload of size >253. This is because we were decoding the length (a BigSize, big-endian) as a VarInt (little-endian). Found in lightningdevkit#1652.
As observed by @wpaulino, this struct encodes its bytes as big-endian, therefore it's a BigSize, not a VarInt.
dfbebbf
15074bd
to
dfbebbf
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.
reACK dfbebbf
Ah, thought so! |
Prior to this change, we could have failed to decode a valid payload of size >253. This is because we were decoding the length (a BigSize, big-endian) as a VarInt (little-endian).
Plus some minor cleanups. Pair-debugged with @wpaulino.