bolt11: bugfixes and cleanup - #10970
Merged
Merged
Conversation
When truncating a description at 639 bytes it can happen that the trailing part is now an incomplete utf-8 character. Re-encode it and drop the broken character so a stric reader doesn't raise on it later on.
The intended padding in `int_to_data5` was a no-op.
Don't override a date of 0 with the current date if passed to the constructor.
When decoding a invoice with 'n' (pubkey) tag store the pubkey also in the tags. This allows to re-encode the same invoice exactly as it was encoded before (instead of dropping the pubkey). Also when consumers inspect the tags for some purpose later they might expect the pubkey to be in the tags.
When encoding a BOLT11Addr, accept an actual hash as the value of the `h` tag (description hash).
Trampoline t-tags are unused since 196b4c0, there doesn't seem to be any need to keep them around. Trampoline hints are encoded in the regular routing hint r-tags now.
Don't accept bolt11 invoices with '0' amount and leading '0' digits. Explicitly fail on sub-millisat amounts (already indirectly enforced in amount setter). See: https://github.com/lightning/bolts/blob/152897261850d93c4f4597f39cf22d7d22d6ede6/11-payment-encoding.md?plain=1#L69-L70
f321x
force-pushed
the
fix_bolt11_bugs_2
branch
from
September 15, 2026 08:18
05fd26b to
8c5a946
Compare
f321x
commented
Sep 15, 2026
SomberNight
reviewed
Sep 18, 2026
SomberNight
left a comment
Member
There was a problem hiding this comment.
ACK 8c5a946.
Just a minor nit.
Through the removal of t-type routing info tags this argument isn't neccessary anymore.
Member
|
thx |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix some minor bugs in the bolt11.py module and remove t-tag support. See individual commits.