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

lnwire: assert sorted short channel ids #3743

Merged
merged 2 commits into from Dec 4, 2019

Conversation

cfromknecht
Copy link
Collaborator

@cfromknecht cfromknecht commented Nov 20, 2019

This PR modifies our decoding of short channel id arrays to also assert that the decoded ids are in order for the plain encodings. We already do so for the zlib encoding, though this isn't tested directly. Here we correct the decoding make this assertion for plain encodings, and add unit tests to both QueryShortChanIDs and ReplyChannelRange to ensure that they fail with this error when presented with duplicate or unsorted channel ids for either plain or zlib.

lnwire/query_short_chan_ids.go Show resolved Hide resolved
halseth
halseth approved these changes Dec 4, 2019
@halseth halseth merged commit a6ef03c into lightningnetwork:master Dec 4, 2019
2 checks passed
@cfromknecht cfromknecht deleted the in-order-sids branch Dec 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants