lndk-org / lndk

MIT License
76 stars 19 forks source link

Bug: A payment error prevents lndk from being able to make subsequent payments #107

Closed mrfelton closed 2 months ago

mrfelton commented 2 months ago

Describe the bug

A payment error prevents lndk from being able to make subsequent payments

future payments should not error because of a past payment attempt failure

Once a payment has failed, all payments fail.

$ lndk-cli --address=https://olympus-lndus1:10009 --tls-cert=/lndk/.lnd/tls.cert --macaroon=/lndk/.lnd/data/chain/bitcoin/regtest/admin.macaroon --grpc-host=localhost pay-offer lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrc2zfjx7mnpw35k7m3qw3hjqetrd3skjuskyypdejcr3vdjzdfwft48l2j3slmm3wlsvv4ea9jjngancl3jsdhqeqg 10000
Error paying for offer: Status { code: Internal, message: "Internal error: Error signing invoice request: Verification(InvalidSignature)", metadata: MetadataMap { headers: {"content-type": "application/grpc", "date": "Sun, 12 May 2024 10:27:13 GMT", "content-length": "0"} }, source: None }
$ 
$ bash
lndk@753febb267b9:~$ lndk-cli --address=https://olympus-lndus1:10009 --tls-cert=/lndk/.lnd/tls.cert --macaroon=/lndk/.lnd/data/chain/bitcoin/regtest/admin.macaroon --grpc-host=localhost pay-offer lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrc2zfjx7mnpw35k7m3qw3hjqetrd3skjuskyypdejcr3vdjzdfwft48l2j3slmm3wlsvv4ea9jjngancl3jsdhqeqg 10000
Error paying for offer: Status { code: AlreadyExists, message: "LNDK is already trying to pay for provided offer", metadata: MetadataMap { headers: {"content-type": "application/grpc", "date": "Sun, 12 May 2024 10:27:22 GMT", "content-length": "0"} }, source: None }

Environment

Please do not include private information in bug reports!

To Reproduce

  1. Attempt a payment that will fail. It will fail with InvalidSignature error.
  2. Attempt the same payment again. It will fail with AlreadyExists. It should fail with InvalidSignature again.

Additional context Add any other context about the problem here.

orbitalturtle commented 2 months ago

I pushed a fix for this to the grpc server PR: https://github.com/lndk-org/lndk/pull/104 In this commit: https://github.com/lndk-org/lndk/pull/104/commits/d1ac5b3f57d726b4ad427364e36caa36e60a8a1b

If you get another chance to test, let me know :) But I think that should close out this issue.