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

xpay-handle-pay: bugfix, handle null parameters #7958

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Lagrang3
Copy link
Collaborator

Changelog-Fixed: xpay-handle-pay: handle null parameters passed in the "param" list.

Solves issue #7953

Changelog-Fixed: xpay-handle-pay: handle null parameters passed in the "param" list.

Reported-by: @hMsats
Signed-off-by: Lagrang3 <[email protected]>
@Lagrang3 Lagrang3 force-pushed the xpay-handle-null-params branch from c1a5c6e to 9e1f00b Compare December 19, 2024 09:59
Changelog-None: xpay-handle-pay: don't assume bolt11 param is non NULL

Signed-off-by: Lagrang3 <[email protected]>
@Lagrang3
Copy link
Collaborator Author

Lagrang3 commented Dec 19, 2024

I tested this with netcat command through the naked lightning-rpc socket.
eg.

echo "{\"jsonrpc\":\"2.0\",\"id\":\"nc\",\"method\":\"pay\",\"params\":[\"lnbcrt...\",null]}" | nc -U /tmp/l1/regtest/lightning-rpc

I don't know if we have the tools to test this with the current pyln library.

UPD. Yes we can test it. I am adding regtests for this.

Changelog-None: xpay-handle-pay: test null params in json array.

Signed-off-by: Lagrang3 <[email protected]>
@rustyrussell
Copy link
Contributor

Nice catch! We generally use dicts for param passing (it's just better for almost so uses), so I forgot about this corner case!

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