lnd: [bug]: Unknown Unconfirmed Balance

Background

I folks, am running LND as a router. I have unconfirmed balance and not really sure what’s happening. Haven’t made any channel opens or blockchain payments since way before this issue came up. So I think it must be related to lnd closing a channel.

Here’s the relevant data:

$ lncli walletbalance | grep uncon
    "unconfirmed_balance": "1051070",
            "unconfirmed_balance": "1051070"
$ lncli listunspent --unconfirmed_only
{
	"utxos": [
		{
			"address_type": 4,
			"address": "bc1pgptzpw0jr635psy7z4wzm5e74sqlmf96wfqe0uzd9jvpwjjw0adqnek4jc",
			"amount_sat": 1051070,
			"pk_script": "5120405620b9f21ea340c09e155c2dd33eac01fda4ba724197f04d2c98174a4e7f5a",
			"outpoint": "3bc2fa79c945da5f5d457954a2235678ad3e1c1b3a3d7cbd831cff14984cab97:0",
			"confirmations": 0
		}
	]
}
$ lncli pendingchannels
{
    "total_limbo_balance": "0",
    "pending_open_channels": [
    ],
    "pending_closing_channels": [
    ],
    "pending_force_closing_channels": [
    ],
    "waiting_close_channels": [
    ]
}

The relevant transaction doesn’t appear on public trackers. Any idea what happened and how to fix?

Your environment

  • version of lnd
$ lnd --version
lnd version 0.15.2-beta commit=v0.15.2-beta
  • which operating system (uname -a on *Nix)
$ uname -a
Linux ip-172-31-22-39 5.18.12-1-ec2 #1 SMP PREEMPT_DYNAMIC Sat, 16 Jul 2022 21:17:41 +0000 x86_64 GNU/Linux

(Modified arch linux)

  • version of btcd, bitcoind, or other backend (neutrino backend)

  • any other relevant environment details Happy to grep some logs if you can give pointers. The ERR logs are a bit noisy. Here’s the tail end:

Nov 02 07:22:59 [REDACTED_IP] lnd[265812]: 2022-11-02 07:22:59.278 [ERR] HSWC: Unhandled error while reforwarding htlc settle/fail over htlcswitch: UnknownNextPeer
Nov 02 07:23:04 [REDACTED_IP] lnd[265812]: 2022-11-02 07:23:04.825 [ERR] HSWC: UnknownNextPeer
Nov 02 07:23:04 [REDACTED_IP] lnd[265812]: 2022-11-02 07:23:04.825 [ERR] HSWC: Unhandled error while reforwarding htlc settle/fail over htlcswitch: UnknownNextPeer
Nov 02 07:46:13 [REDACTED_IP] lnd[265812]: 2022-11-02 07:46:13.491 [ERR] HSWC: insufficient bandwidth to route htlc
Nov 02 07:46:13 [REDACTED_IP] lnd[265812]: 2022-11-02 07:46:13.491 [ERR] HSWC: Unhandled error while reforwarding htlc settle/fail over htlcswitch: insufficient bandwidth to route htlc
Nov 02 07:46:18 [REDACTED_IP] lnd[265812]: 2022-11-02 07:46:18.812 [ERR] HSWC: insufficient bandwidth to route htlc
Nov 02 07:46:18 [REDACTED_IP] lnd[265812]: 2022-11-02 07:46:18.812 [ERR] HSWC: Unhandled error while reforwarding htlc settle/fail over htlcswitch: insufficient bandwidth to route htlc
Nov 02 07:52:31 [REDACTED_IP] lnd[265812]: 2022-11-02 07:52:31.461 [ERR] HSWC: insufficient bandwidth to route htlc
Nov 02 07:52:31 [REDACTED_IP] lnd[265812]: 2022-11-02 07:52:31.461 [ERR] HSWC: Unhandled error while reforwarding htlc settle/fail over htlcswitch: insufficient bandwidth to route htlc
Nov 02 07:58:37 [REDACTED_IP] lnd[265812]: 2022-11-02 07:58:37.418 [ERR] LTND: Unable to lookup witness: no witnesses

About this issue

Most upvoted comments

I seem to be having the same issue. sweeper went nuts with a bunch of txns which never go into mempool until 100% of UTXO was showing as unconfirmed. I did a rescan, now 2 remain.

"utxos": [
                {
                        "address_type": 4,
                        "address": "bc1pfec57mkv3n90xpa3c379rds72ru9ldydkmjanz37kkg9crjxgxpqrvtzpg",
                        "amount_sat": 2076264,
                        "pk_script": "51204e714f6ecc8ccaf307b1c47c51b61e50f85fb48db6e5d98a3eb5905c0e464182",
                        "outpoint": "53085820a65121739be6ffb067aedbfff10ddf7f6883b61e4631b8dc2c5adfad:0",
                        "confirmations": 0
                },
                {
                        "address_type": 4,
                        "address": "bc1py45gpxlexcdvwgne7cmfh8zngd6llqpede02zjwmkdu6fmd8x3vqjd0p72",
                        "amount_sat": 2052362,
                        "pk_script": "51202568809bf9361ac72279f6369b9c534375ff80396e5ea149dbb379a4eda73458",
                        "outpoint": "1e345ec40d3a02ddef1112f9425599e51e72269255f3185effcc05a91261f33a:0",
                        "confirmations": 0
                }
        ]

When I query the transaction from listchaintxns I get the raw tx. When I broadcast, I get no error from lnd, but on external site I get this error:

"Code: -26, Error: insufficient fee, rejecting replacement 53085820a65121739be6ffb067aedbfff10ddf7f6883b61e4631b8dc2c5adfad, less fees than conflicting txs; 0.00000183 < 0.00000194"

Digging deeper, I find that the first input is a lightning anchor, and has been swept already. https://mempool.space/address/bc1qrh433dns65em58nrxc3jmqz80zfjphccawn74xr60feuna8m8wvsdw2j60

It seems that this address is collecting and sweeping lots of lightning anchors. https://mempool.space/address/bc1ptztt50y5xk2pngsf8kfjd5qvek7qg485ks6nj8aq9p2k25mgqrwsy8rsar

So maybe this is not detected by LND, and it’s broadcasting a transaction with invalid input? I mean, these are all 330 sat utxos, but this address has collected a ton of these. What’s going on?

I am running LND 0.15.4-beta

Hi @WalterSmuts! Thanks for opening the issue 😃

On first glance, this looks very similar to #6367, #6231, #6498, #6434

Could you perhaps grep your logs for the transaction ID? (3bc2fa79c945da5f5d457954a2235678ad3e1c1b3a3d7cbd831cff14984cab97)