BlueWallet / LndHub

Wrapper for Lightning Network Daemon. It provides separate accounts for end-users
http://LndHub.io
MIT License
744 stars 180 forks source link

After lightning wallet transactions between internal LndHub accounts finished, corresponding lightning invoices did not get closed #461

Open zwan2016 opened 2 years ago

zwan2016 commented 2 years ago

LndHub version: v1.4.1 Lnd version: v0.14.3-beta BlueWallet version: 6.2.12 (build 1643409602 master)

We are only discussing Lightning Wallets on BlueWallet app, and the Lnd node is running in testnet mode.

Issue: There are 2 BlueWallet Lighting wallets loaded with some satoshi, 'wallet A' generates an invoice using BlueWallet, 'wallet B' then pays this invoice through BlueWallet, and 'wallet A' received the money as expected, this money got deducted from 'wallet B' balance as well. This is all inside of one instance of LndHub, so there is no need to go through lightning network, and it doesn't. Everything is expected except the generated lightning invoice is not closed, it still can be paid through lightning network. And if you paid it anyway, this payment won't reflect on 'wallet A' balance.

In my imagination, once this internal transaction finished, the generated lightning invoice should be closed in lightning network. Please confirm this issue, or maybe this is a designed behavior and I missed something.

Overtorment commented 2 years ago

this is expected.

PS. i dont see a way to 'close' unpaid invoice. even it there were, that would require to add more code in handling lndhub's internal invoices to fix very obscure use case that never happens

zwan2016 commented 2 years ago

Hi @Overtorment , I believe this api (https://api.lightning.community/#cancelinvoice) would be able to cancel an unsettled invoice.