spesmilo / electrum

Electrum Bitcoin Wallet
https://electrum.org
MIT License
7.52k stars 3.1k forks source link

force close due to expiring htlcs - too aggressive #8683

Closed ecdsa closed 1 year ago

ecdsa commented 1 year ago

I recently had a channel force closed because of an expiring HTLC following a submarine swap with hold invoice. Here is what happened:

Note that the client should not fail the HTLC, because they would be losing money at this point.

A possible fix is to record when the HTLC was settled, and give some time to the peer to send revack. Unfortunately, this probably requires a db upgrade, because we would need to store the timestamp of the update_fulfill_htlc message.

ecdsa commented 1 year ago

Fixed without db upgrade. I guess that should be fine in most situations.

SomberNight commented 1 year ago

https://github.com/spesmilo/electrum/commit/98f9f295cfd5f8574ef4732de71274510c3f153d looks good