Support reading channel_updates in onions with message type bytes
#1455
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Historically c-lightning and eclair have always sent
channel_updatemessages inside the onion error packets with thetwo message type bytes (
0x0102forchannel_updatemessages) butlnd and us skipped those bytes. We only supported decoding messages
matching our own encoding - decoding a bogus
channel_updateifthe extra bytes were included.
Here we detect the type bytes and, if they're present, start
reading at offset 2.
We also take this opportunity to improve loging and make the
severity more accurate for the previous error.
Fixes #1450.
This really needs tests and we need to change the encoding end as well - THIS IS UP FOR GRABS IF SOMEONE WANTS TO WRITE TESTS and change the encoding end, otherwise I'll get to it eventually, but I run this code locally.