refactor(splitpayments): Improve LNURL payment reliability#34
Closed
santyr wants to merge 5 commits intolnbits:mainfrom
Closed
refactor(splitpayments): Improve LNURL payment reliability#34santyr wants to merge 5 commits intolnbits:mainfrom
santyr wants to merge 5 commits intolnbits:mainfrom
Conversation
api_lnurlscan function is being imported from nbits.core.views.api, but it is located in lnbits.core.views.lnurl_api. This corrects the import path, resolving the error.
`api_lnurlscan` function returns a `LnurlPayResponse` object, not a dictionary. The code was attempting to access its properties using dictionary subscription (`data['callback']`), which caused a `TypeError`. Updated the code to use attribute access (`data.callback`) to correctly handle the response object and resolve the runtime error.
The extension was silently failing when processing LNURL payments because it was calling the `api_lnurlscan` web endpoint. Errors from the `lnurl` library were being caught and returned as `None`, halting the process without a specific error log. This commit changes the implementation to use the `lnurl.handle` function directly, bypassing the API layer. This provides more direct error handling, logs specific LNURL failures, and prevents the task from failing silently.
Remove extra memo and payment hash from memo generation.
…dling Valid Lightning Addresses containing uppercase characters (e.g., `Name@domain.com`) were being incorrectly rejected with an "Invalid Lightning address" error. This was caused by the underlying `lnurl-python` library performing a strict, case-sensitive validation, which violates the case-insensitive LUD-16 specification. This commit fixes the issue by converting the address to lowercase before it is passed to the `lnurl_handle` function. This ensures compliance with the spec and allows all valid Lightning Addresses to be processed correctly, regardless of case.
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.
Tested with LNBits v1.3.0-rc2
This refactor overhauls the get_lnurl_invoice function to make it more robust, reliable, and independent of the web API layer, ensuring that errors are logged correctly and payments are processed as expected.
Changes Made