Skip to content

pyln-proto: keep every route hint when decoding an invoice - #9780

Open
takinanton wants to merge 1 commit into
ElementsProject:masterfrom
takinanton:pyln-proto-route-hints
Open

takinanton wants to merge 1 commit into
ElementsProject:masterfrom
takinanton:pyln-proto-route-hints

Conversation

@takinanton

Copy link
Copy Markdown

Invoice.decode() in pyln-proto assigned route_hints again on every r field so a BOLT11 invoice with more than one came back with only the last hint. encode() writes one r field per hint so its own output did not round trip either. Decode now keeps all of them.

The new test encodes an invoice with two hints and decodes it. Before the fix it got one hint back and now it gets both. Ran the pyln-proto tests only which gives 44 passed and 1 skipped. I did not build lightningd or run the integration tests.

Checklist

Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:

  • The changelog has been updated in the relevant commit(s) according to the guidelines.
  • Tests have been added or modified to reflect the changes.
  • Documentation has been reviewed and updated as needed.
  • Related issues have been listed and linked, including any that this PR closes.
  • Important All PRs must consider how to reverse any persistent changes for tools/lightning-downgrade

🤖 Generated with Claude Code

Invoice.decode() replaced route_hints on each `r` field so an invoice
with several of them came back with only the last one. encode() writes
one `r` field per hint so even its own output did not round trip.

Changelog-Fixed: pyln-proto: `Invoice.decode()` no longer drops all but the last `r` field of a BOLT11 invoice.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant