You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LND: unconfirmed balance counts every RBF replacement of a force-close sweep #4778
Found while testing #4775 on regtest (lnd 0.20.0, LND REST).
When a force-close sweep doesn't confirm in the next block, lnd replaces it via RBF on every new block. The mempool only holds the newest version, but the wallet keeps every replaced version as unconfirmed and unspent (listchaintxns, listunspent). lnd's unconfirmed_balance therefore grows by one sweep amount per block, and ZEUS shows it as external unconfirmed funds on the pending line.
Measured (limbo 96,860, confirmed 991,415)
Empty blocks
Sweep versions in wallet
lnd unconfirmed_balance
ZEUS total + pending
Actual
0
96,395
96,395
1,088,275
1,087,810
1
+ 96,348
192,743
1,184,158
1,087,763
2
+ 96,300
289,043
1,280,458
1,087,715
3
+ 96,252
385,295
1,376,710
1,087,667
It clears once one version confirms: the replaced versions disappear from the wallet, and the balance is exact again.
On mainnet a sweep that waits several blocks is common when mempool is busy, so the pending line can show a multiple of the channel balance for that period.
Possible direction: unconfirmed wallet transactions that spend the same outpoint conflict by consensus, so only one of them can confirm. Count only one of them, and in the total as well, since total_balance includes all versions. Presumably this affects any replaced transaction paying the wallet, not just sweeps (untested). I haven't checked yet whether lnd tracks this upstream.
Reproduce
Force close an anchor channel locally. Mine until lnd broadcasts the sweep (one block before maturity).
Mine empty blocks so the sweep can't confirm, in Polar via btc backend terminal:
Activity
kaloudis commentedon Sep 28, 2026
@myxmaster found it: lightningnetwork/lnd#5225