lnd icon indicating copy to clipboard operation
lnd copied to clipboard

[Feature Request] Don't resolve HTLC (Channel) on chain automatically if there is no danger of loosing funds

Open ziggie1984 opened this issue 3 years ago • 3 comments

Background

While rebalancing channels own-initiated-HTLCs (selfpayments) might get stuck, though as long as the node has not released the preimage for that payment its safe to not force-close this channel automatically in case the HTLC expires. But its important that this HTLC will always fail after the expiry date so that we don't risk any funds.

Feature Request

Lnd checks whether the HTLC which expired is a self-payment and whether the preimage was already released for that payment. If not, it should not force-close the channel and in addition always fail this payment after the expiry period.

ziggie1984 avatar Sep 21 '22 08:09 ziggie1984

Would be great to have but what about the other side? When it comes online it sees that stuck expired HTLC and it doesn't know whether it's a self-payment from your node or not. It will force close then regardless.

rkfg avatar Sep 21 '22 11:09 rkfg

I don't think the other side cares about an incoming HTLC he does not have the preimage to. Even currently I don't think the other side will closing anything related to incoming HTLCs bc there is no benefit for this node as long it does not have the preimage

ziggie1984 avatar Sep 21 '22 11:09 ziggie1984

I think we can close as a duplicate of https://github.com/lightningnetwork/lnd/issues/1226? Or at least a special case of it (own HTLC).

Roasbeef avatar Sep 21 '22 18:09 Roasbeef

Sound good closing in favour of #1226

ziggie1984 avatar Sep 23 '22 15:09 ziggie1984

not sure but my investigation lead me to this

; payments-expiration-grace-period=30s

I think it actually implements this feature or am I wrong ?

ziggie1984 avatar Oct 02 '22 18:10 ziggie1984