bitkit
bitkit copied to clipboard
[Bug]: It is possible to receive payments twice with same LN invoice
Describe the bug
Using bitkit or WOS we were able to send to the same LN invoice a few times.
Reproduce
- Create LN invoice
- Payit using different wallets
- You will receive funds a few times
Screenshots / Recording
receiver history:
receiver payment1:
receiver payment2:
sender1 payment details:
sender2 payment details:
Operating system
iOS, Android
Bitkit version
v94
Log output
After restarting the app I only see one payment. But before I did so, I was able to send 10 sats to another wallet
This issue it's still not fix
Fix is here. Will update when in Bitkit.
Tested on acf22eef1c63cad1dff84bc3304173825d01f6c0
The good: I haven't been able to pay an invoice twice, I always see an error. The bad: The error is displayed later in the flow than it could be. It'd be good to reject the action at the point of input/scan. The ugly: Presentation of the error message.
https://github.com/synonymdev/bitkit/assets/74595920/dc33090f-05c1-4963-91c6-14ae1b746394
So I agree with the bad and ugly part but this is a separate issue can be made for this. The fix I did here was to prevent duplicate payments from the receiver side. It's always been blocked on the sender side when trying to pay same invoice twice.
What was happening was 2 different lightning wallets were able to pay the same invoice, in this case they both thought they were the first so there was no check. So now with the fix the receiver enforces this check and only accepts the 1st payment.
Yup, agreed. Raised https://github.com/synonymdev/bitkit/issues/1911.
Retested this using two different wallets to pay the same invoice and was not able to, so I'm happy to close this one.