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

Keysend using gRPC lnrpc.Lightning.SendPayment fails if PaymentAddr is empty #5413

Closed
bjarnemagnussen opened this issue Jun 21, 2021 · 1 comment · Fixed by #5419
Closed
Labels
bug Unintended code behaviour P2 should be fixed if one has time rpc Related to the RPC interface
Milestone

Comments

@bjarnemagnussen
Copy link
Contributor

bjarnemagnussen commented Jun 21, 2021

Background

Using the lnrpc.Lightning.SendPayment gRPC fails with the error incorrect_payment_details if PaymentAddr in the SendRequest is empty using keysend.

Your environment

  • version of lnd: 0.13.0

Steps to reproduce

Calling lnrpc.Lightning.SendPayment with e.g. the SendRequest used for a keysend:

{
  "dest": DestPubKey,
  "amt": Amount,
  "payment_hash": PayHash,
  "final_cltv_delta": 40,
  "dest_custom_records": {
    "5482373484": Preimage
  }
}

Expected behaviour

Keysend should be successful.

Actual behaviour

It seems that 46c9140 which fixed a nil-panic regarding not defining the PaymentAddr did not address the case that when it is not specified an empty bytearray is used instead of its nil value.

Hence

lnd/rpcserver.go

Line 4353 in f9a5188

copy(payIntent.paymentAddr[:], rpcPayReq.PaymentAddr)
copies per default the empty bytearray, which will later down in the function call cause an incorrect_payment_details as a correct Payment Address is expected.

@Roasbeef Roasbeef added bug Unintended code behaviour rpc Related to the RPC interface labels Jun 21, 2021
@Roasbeef Roasbeef added this to the 0.13.1 milestone Jun 21, 2021
@Roasbeef Roasbeef added the P2 should be fixed if one has time label Jun 21, 2021
@bjarnemagnussen
Copy link
Contributor Author

I will take a closer look at it to find a fix for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unintended code behaviour P2 should be fixed if one has time rpc Related to the RPC interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants