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

handle tu64 fields of any size #7

Merged
merged 2 commits into from
Nov 7, 2024
Merged

handle tu64 fields of any size #7

merged 2 commits into from
Nov 7, 2024

Conversation

JssDWt
Copy link
Collaborator

@JssDWt JssDWt commented Nov 7, 2024

tu64 is a truncated integer, with omitted leading zero bytes. This means a tu64 can be any length. Previously the get_tu64 function could only handle tu64 fields with a length of 1, 2, 4 or 8. Now it can handle all lengths.

Greenlight truncates the leading zero bytes here:
https://github.com/Blockstream/greenlight/blob/3a913fef893cc04d374c29853a45bb225349ea1b/libs/gl-plugin/src/tlv.rs#L146-L151

Fixes the error: Got invalid amount of len 3 in htlc TLV: Unexpect TU64 length: 3

tu64 is a truncated integer, with omitted leading zero bytes. This means
a tu64 can be any length. Previously the `get_tu64` function could only
handle tu64 fields with a length of 1, 2, 4 or 8. Now it can handle all
lengths.
@JssDWt JssDWt requested a review from roeierez November 7, 2024 10:11
@JssDWt JssDWt requested a review from hydra-yse November 7, 2024 10:46
@JssDWt JssDWt merged commit 7291f74 into main Nov 7, 2024
11 checks passed
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.

2 participants