-
Notifications
You must be signed in to change notification settings - Fork 887
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Firstly, I wanted the results easier to use: 1. Make them always lower case, even if the string was UPPER. 2. Decode the payload for them. 3. Don't give the user any fields they don't need, and make the field sizes explicit. Secondly, I wanted to avoid the pattern of "check in one place, assume in another", in favour of "check on use". So, I changed the code to lower the string if it needs to at the start, and then changed the pull functions so we always use them to get data: this way we should fail clearly and gracefully if we don't have enough data. I made all the checks explicit, where we assign the fields. I also addressed the FIXME: I think the array is *often* one shorter, but not always, so I trim the last byte at the end if needed. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
- Loading branch information
1 parent
a62f8fc
commit 5015305
Showing
2 changed files
with
135 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters