lnd: lncli walletbalance shows incorrect walletbalance
Background
Sometime the last version of LND shows to me incorrect balance of wallet. To see examples below
Your environment
- version of
lndcommit cfb5e249b9d6dae9e44dcf56c29c3eda531290fe (actual master at 2019-03-11) - which operating system (
uname -aon *Nix) CentOS 6 - version of
btcd,bitcoind, or other backend 0.17.1
Steps to reproduce
Don’t know
Expected behaviour
It should show correct balance from confirmed UTXO from wallet
Actual behaviour
For example right now i saw:
l walletbalance
{
"total_balance": "85601",
"confirmed_balance": "85601",
"unconfirmed_balance": "0"
}
I know that node has 25 BTC. Some BTC in channels. I checked:
l listchannels|grep local_balance|sed -r -e 's#.*"([0-9]+)".*#\1#'|awk '{s+=$1} END {print s}'
1836160500
l pendingchannels|grep local_balance|sed -r -e 's#.*"([0-9]+)".*#\1#'|awk '{s+=$1} END {print s}'
39769984
After i did for checking:
l listchaintxns|grep amount|sed -r -e 's#.*"(-?[0-9]+)".*#\1#'|awk '{s+=$1} END {print s}'
635162828
I saw that all UTXO in wallet are confirmed. So the walletbalance should be show this number but it shows the 85601
After i restarted the LND and after restart:
l walletbalance
{
"total_balance": "635162828",
"confirmed_balance": "635162828",
"unconfirmed_balance": "0"
}
Because i restarted i didn’t catch the bug but i have other lnd node where i see right now the same problem. But i didn’t restarted yet.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (7 by maintainers)
And my suggestion to extend walletbalance info. For example to add 4th field where will be balances of blocked amounts of autopilot for example or locked sums which are not seen.
I think you will constantly have reports from users that somewhere something is lost in the balance of wallet. All problems from that. It’s because you don’t have a clear debit / credit. It scares sometimes.
Ok, i will try. But now i already made many changes with channels, i think there many changes and i will be needed to start again When i will see same error i will let to know - i will send full logs and full dump of listchaintxns Ok?
No, it’s other node - lnd-07 I can send the full log to you (through gpg encrypting) as i did already if you need