lnd: [bug]: Pending HTLC in force closed channel although it's has been already resolved by the network

Background

This is similar issue as: https://github.com/lightningnetwork/lnd/issues/8269

Channel on my node got force-closed and bunch of HTLCs were pending so besides paying huge amounts of sats on fees (huge issue), after 5+ days the channel is still pending close with negative blocks_til_maturity on pending HTLC which was in fact already resolved (10002 sats), check https://mempool.space/tx/43d5ab635d2281d876f07118a9a31454783f1a78a6bbaec8ddae69f6d120ad48#vout=2 :

This is how output of lncli pendingchannels:

"pending_force_closing_channels": [
        {
            "channel": {
                "remote_node_pub": "02d96eadea3d780104449aca5c93461ce67c1564e2e1d73225fa67dd3b997a6018",
                "channel_point": "f3375cbf2092f48c6af91678e174d590e6c1b59bfa8e0c0bb654ac26f7c3c4f6:1",
                "capacity": "6000000",
                "local_balance": "122778",
                "remote_balance": "5687380",
                "local_chan_reserve_sat": "0",
                "remote_chan_reserve_sat": "0",
                "initiator": "INITIATOR_LOCAL",
                "commitment_type": "ANCHORS",
                "num_forwarding_packages": "0",
                "chan_status_flags": "",
                "private": false,
                "memo": ""
            },
            "closing_txid": "43d5ab635d2281d876f07118a9a31454783f1a78a6bbaec8ddae69f6d120ad48",
            "limbo_balance": "10332",
            "maturity_height": 0,
            "blocks_til_maturity": 0,
            "recovered_balance": "0",
            "pending_htlcs": [
                {
                    "incoming": false,
                    "amount": "10002",
                    "outpoint": "72d9c5219f6e2ae260a3f282ed431ab46a3978961f74f71495bd5f79da4a8dda:0",
                    "maturity_height": 821056,
                    "blocks_til_maturity": -118,
                    "stage": 2
                }
            ],
            "anchor": "LIMBO"
        }
    ],

When I restart node, I receive following error is logs:

2023-12-14 15:36:52.448 [ERR] BTCN: Broadcast attempt failed: unable to replace transaction: -26: insufficient fee, rejecting replacement 8c09a0da9991989c333c2f72c20a9ace3d5d67a8c475e5e44a096c6f5abfe940; new feerate 0.00001011 BTC/kvB <= old feerate 0.00003343 BTC/kvB
2023-12-14 15:36:52.455 [ERR] SWPR: Publish sweep tx 8c09a0da9991989c333c2f72c20a9ace3d5d67a8c475e5e44a096c6f5abfe940 got error: transaction rejected: output already spent
2023-12-14 15:37:01.575 [ERR] HSWC: unable to find target channel for HTLC fail: channel ID = 810572:871:1, HTLC ID = 205935
2023-12-14 15:37:01.575 [ERR] HSWC: Unable to forward resolution msg: unable to find target channel for HTLC fail: channel ID = 810572:871:1, HTLC ID = 205935

Your environment

  • version of lnd: v0.17.2
  • which operating system (uname -a on *Nix): Linux 5.15.0-91-generic # 101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
  • version of btcd, bitcoind, or other backend: v25.0

Steps to reproduce

Can’t reproduce, force-close came out of nowhere, didn’t have any expiring HTLCs (having it monitored)

Expected behaviour

No Force Close in the first place and if that happens, it should not stay in Limbo after maturity

Actual behaviour

Above

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Comments: 16 (1 by maintainers)

Most upvoted comments

@ziggie1984 ok I get it. On the other hand, I am glad it doesn’t take my sats from wallet! Previous HTLC from this FC did and took additional 50k sats from my wallet 😦. Very bad because I wasn’t able to stop it and couldn’t do anything to prevent using extra wallet funds.