synonymdev / bitkit

Self-custodial Bitcoin and Lightning Wallet for Android and iOS.
https://bitkit.to
MIT License
116 stars 23 forks source link

[Bug]: Manually Setup LN connection to LND3 didn't return funds #2268

Closed catch-21 closed 1 week ago

catch-21 commented 2 weeks ago

Describe the bug

After closing a LN connection with LND3 that was setup using the Manual Setup flow, Bitkit told me that "Your funds have been transferred. You are able to use these funds immediately." yet there is no trace of an activity showing the funds have been returned. The closed connection has a Closure reason "ProcessingError".

Using sparrow, I can confirm there is no onchain transaction sent to this wallet, so perhaps I need to wait longer.

bitkit_ldk_logs_1727763581718.zip

Reproduce

  1. Go to Advanced settings -> Lightning Connections -> Add Connection
  2. Establish a new connection to a known usable LN node, such as LND3 03816141f1dce7782ec32b66a300783b1d436b19777e7c686ed00115bd4b88ff4b@34.65.191.64:9735
  3. Once the transaction is confirmed and transfer is complete, close the channel using the normal Transfer to Spending flow.
  4. Once the flow gets to the "FUNDS MOVED TO SAVINGS" "Your funds have been transferred. You are able to use these funds immediately." page, tap Continue button.
  5. Observe that no Transfer from Spending activity appears.
  6. Observe in Lightning Connections that the closed connection has Closure reason "ProcessingError"

Screenshots / Recording

Screenshot 2024-10-01 at 13 19 19

Operating system

Android 14

Bitkit version

1.0.5 (136)

Log output

No response

Jasonvdb commented 1 week ago

The force close is unfortunate, not sure how we're ever going to get nodes we don't control to agree on fees.

2024-10-01 06:05:00 UTC ERROR (LDK): Closing channel 59e11f494092ecde6545be97bf9fa2d4ce5f0f26b6efcb7c236659eec8fa15dd due to close-required error: Unable to come to consensus about closing feerate, remote wants something (308 sat) lower than our min fee (361 sat) (lightning::ln::channelmanager 7236)
2024-10-01 06:05:00 UTC ERROR (LDK): Force-closing channel: Unable to come to consensus about closing feerate, remote wants something (308 sat) lower than our min fee (361 sat) (lightning::ln::channelmanager 9483)
2024-10-01 06:05:00 UTC DEBUG (LDK): Finishing closure of channel due to Channel closed because of an exception: Unable to come to consensus about closing feerate, remote wants something (308 sat) lower than our min fee (361 sat) with 0 HTLCs to fail (lightning::ln::channelmanager 3245)
2024-10-01 06:05:00 UTC INFO (LDK): Applying force close update to monitor 59e11f494092ecde6545be97bf9fa2d4ce5f0f26b6efcb7c236659eec8fa15dd with 1 change(s). (lightning::chain::channelmonitor 2891)

Logs show these are your funds that should be good to be swept if you open the wallet again. Confirmation height was 30 hours ago.

{"confirmation_height":863746,"type":"ClaimableAwaitingConfirmations","amount_satoshis":99457}

@catch-21 can you check this wallet again?

catch-21 commented 1 week ago

I can confirm the funds have been returned onchain. We have https://github.com/synonymdev/bitkit/issues/2270 and https://github.com/synonymdev/bitkit/issues/2273 to improve communication to the user when force close occurs. So I will close this ticket now. Thanks @Jasonvdb.