lnd: walletbalance shows wrong confirmed balance, channels stuck as pending

Background

lncli walletbalance is showing confirmed balance which I don’t have. lnd lets me open a channel with those funds, but obviously failing to send out the opening transactions because those outputs are already spent. Channels remain pending for over 1 month now, lncli walletbalance is still showing a wrong balance.

Your environment

  • version of lnd 0.4.2
  • which operating system (uname -a on *Nix) 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64 GNU/Linux
  • version of btcd, bitcoind, or other backend bitcoind (0.16.1)
  • any other relevant environment details

Steps to reproduce

In my case my walletbalance shows { "total_balance": "139197", "confirmed_balance": "139197", "unconfirmed_balance": "0" } Although I only really have about 12000 sat. lnd allows me to open a channel with those non existing funds, those channels show up as pending

{
    "total_limbo_balance": "0",
    "pending_open_channels": [
        {
            "channel": {
                "remote_node_pub": "0374ecf61ed6c1208c42339f47decde2bc0c4393ac95f07827b3471e939d7eb961",
                "channel_point": "69a75bfae6642276efc1bbbf3d8860e3710cc6894c0cfaa438b4987418837427:1",
                "capacity": "110000",
                "local_balance": "109819",
                "remote_balance": "0"
            },
            "confirmation_height": 0,
            "commit_fee": "181",
            "commit_weight": "600",
            "fee_per_kw": "250"
        },
        {
            "channel": {
                "remote_node_pub": "0374ecf61ed6c1208c42339f47decde2bc0c4393ac95f07827b3471e939d7eb961",
                "channel_point": "835672640218607009922e594baba1d3fdad67fb181aab44e84852051d5361bf:0",
                "capacity": "116252",
                "local_balance": "115528",
                "remote_balance": "0"
            },
            "confirmation_height": 0,
            "commit_fee": "724",
            "commit_weight": "600",
            "fee_per_kw": "1000"
        }
    ],
    "pending_closing_channels": [
    ],
    "pending_force_closing_channels": [
    ],
    "waiting_close_channels": [
    ]
}

but the opening transactions obviously never goes out

log says:

2018-05-31 18:51:13.139 [ERR] FNDG: Unable to complete reservation sign complete: Transaction rejected: output already spent
2018-05-31 18:51:13.139 [ERR] FNDG: Failing funding flow: Transaction rejected: output already spent ((*lnwire.Error)(0xc42e7021c0)({
2018-05-31 18:51:13.139 [ERR] RPCS: unable to open channel to NodeKey(0374ecf61ed6c1208c42339f47decde2bc0c4393ac95f07827b3471e939d7eb961): Transaction rejected: output already spent

2018-06-03 23:22:22.708 [ERR] FNDG: Unable to complete reservation sign complete: Transaction rejected: output already spent
2018-06-03 23:22:22.708 [ERR] FNDG: Failing funding flow: Transaction rejected: output already spent ((*lnwire.Error)(0xc4220b07c0)({
2018-06-03 23:22:22.708 [ERR] RPCS: unable to open channel to NodeKey(0374ecf61ed6c1208c42339f47decde2bc0c4393ac95f07827b3471e939d7eb961): Transaction rejected: output already spent

The weird thing about it is that the balance disappears as confirmed balance from lncli walletbalance, after trying to open a channel with those funds, but after some time (I guess hours) it reappears as confirmed balance while the channel is still pending.

Expected behaviour

lncli walletbalance not showing spent outputs as confirmed

Actual behaviour

lncli walletbalance showing funds which were already spent as confirmed, reappearing after trying to open a channel with those “non existent” funds while the channel stays pending.

When trying to send an onchain transaction

lncli sendcoins --addr 34bFuLRhXgD8En6k3pgokDaqHck6yzpUmL --amt 130000 --sat_per_byte 1
[lncli] rpc error: code = Unknown desc = insufficient funds available to construct transaction

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 45 (28 by maintainers)

Commits related to this issue

Most upvoted comments

I’ve managed to get rid of these forever-pending channels, with Veggen @ #lnd help! You just have to force-close that channel! All 6 pendings are gone now.

If I would update lnd now, would these pending channels that used spent utxo’s magically disappear, or something specific would need to be done?

it also triggers a rescan from when the channel was opened causing me long startup times

Rescans in master for historical spend dispatches are now async.