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

[bug]: Invalid flags after payinvoice's pay_req are being ignored #9440

Open
arturgontijo opened this issue Jan 23, 2025 · 0 comments
Open
Labels
bug Unintended code behaviour needs triage

Comments

@arturgontijo
Copy link

arturgontijo commented Jan 23, 2025

Background

Flags after lncli payinvoice [command options] pay_req are being ignored.

Your environment

  • version of lnd: lnd-darwin-arm64-v0.18.4-beta
  • which operating system (uname -a on *Nix): Darwin 24.2.0
  • version of btcd, bitcoind, or other backend: bitcoind@v28.0.0
  • any other relevant environment details

Steps to reproduce

These fail as expected:

lncli -n=signet payinvoice --last_hop=123 lntbs60030...hj32cppyeeac
>>> [lncli] invalid vertex string length of 3, want 66

lncli -n=signet payinvoice lntbs60030...hj32cppyeeac --last_hop=123
>>> [lncli] invalid vertex string length of 3, want 66

lncli -n=signet payinvoice --last_hop_non_existing=123 lntbs60030...hj32cppyeeac
>>> [lncli] flag provided but not defined: -last_hop_non_existing

But this doesn't:

lncli -n=signet payinvoice lntbs60030...hj32cppyeeac --last_hop_non_existing=123
>>> Payment hash: ...
Description: ...
Amount (in satoshis): 1
Fee limit (in satoshis): 300
Destination: ...
Confirm payment (yes/no): no
[lncli] payment not confirmed

Expected behaviour

Shouldn't we do the same check as we do for sendpayment here?

lncli -n=signet sendpayment --last_hop=123 --pay_req=lntbs60030...hj32cppyeeac
>>> [lncli] invalid vertex string length of 3, want 66

lncli -n=signet sendpayment --pay_req=lntbs60030...hj32cppyeeac --last_hop=123
>>> [lncli] invalid vertex string length of 3, want 66

lncli -n=signet sendpayment --last_hop_non_existing=123 --pay_req=lntbs60030...hj32cppyeeac
>>> [lncli] flag provided but not defined: -last_hop_non_existing

lncli -n=signet sendpayment --pay_req=lntbs60030...hj32cppyeeac --last_hop_non_existing=123
>>> [lncli] flag provided but not defined: -last_hop_non_existing

I think we should output the same error for payinvoice, eg:

lncli -n=signet payinvoice lntbs60030...hj32cppyeeac --last_hop_non_existing=123
>>> [lncli] flag provided but not defined: -last_hop_non_existing

If that makes sense, I can try to implement that check.

@arturgontijo arturgontijo added bug Unintended code behaviour needs triage labels Jan 23, 2025
@arturgontijo arturgontijo changed the title [bug]: [bug]: Invalid flags after payinvoice's pay_req are being ignored Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unintended code behaviour needs triage
Projects
None yet
Development

No branches or pull requests

1 participant