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

lnutil.ImportedChannelBackupStorage: change ser format: int16->uint16 #8266

Merged
merged 1 commit into from
Mar 20, 2023

Conversation

SomberNight
Copy link
Member

In the binary serialised format, replace all instances of int16 with uint16. In particular, this allows port>32767.
Fixes #8264

I think this is backwards compatible, as in, any existing channel backup already out there, should be properly parsed with the new code. (new code however can serialise cbs that old code deserialises incorrectly)

>>> struct.pack('<h', 258)
b'\x02\x01'
>>> struct.pack('<H', 258)
b'\x02\x01'

In the binary serialised format, replace all instances of int16 with uint16.
In particular, this allows port>32767.
Fixes spesmilo#8264

I think this is backwards compatible, as in, any existing channel backup already out there,
should be properly parsed with the new code. (new code however can serialise cbs that old
code deserialises incorrectly)

```
>>> struct.pack('<h', 258)
b'\x02\x01'
>>> struct.pack('<H', 258)
b'\x02\x01'
```
@ecdsa ecdsa merged commit 5ee89a2 into spesmilo:master Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error: short format requires (-0x7fff - 1) <= number <= 0x7fff
2 participants