A bit of a story about my struggles to get BTC out of LND (Part 1)
So I've been working for a while now to get all my BTC back from my LND node which was up for almost a year.
It went through lots of upgrades, and the DB is probably not in tip-top shape either.
So first of all, I closed all of my channels. I had about 100 channels on the node. I was able to cooperatively close many of them, but I had to force close about 20. That means it takes a while to get the funds back. And hopefully, the DB state is correct that I don't accidentally broadcast an old state closing transaction and lose all the funds!
So I closed it all up and I have about 0.6 BTC in my wallet. not bad. I want to send it to my new node.
I sent 0.3 BTC over (from the cooperative closes), and there remains about 0.3 BTC waiting to confirm. Wait overnight...
The next day I use the new -sweepall method on sendcoins to move the rest of the coins, but I"m met with an error: UTXO already spent.
That doesn't sound good. I do some research and I find the dropwutxo tool https://github.com/btcsuite/btcwallet/blob/master/cmd/dropwtxmgr/main.go
I backup my wallet and give it a try. looks like it works. I restart LND and it has to re-scan the blockchain for all the 4800 wallet addresses in the db. This takes about 4 hours.
I open up and check my wallet balance. 0.05 BTC. yikes! Where'd it go? OK - I can accept some of them may have been spent UTXO, but 0.25 BTC is a decent hit to the wallet.
I check my logs and see that there is a sweep transaction which tries to be broadcast, but it doesn't look like it actually gets broadcast. Strange.
I do a pendingchannels and find:
"waiting_close_channels": [
{
"channel": {
"remote_node_pub": "0332052748755d74b3395b91eaea78b53bd64b55eb031ccb6a7ae23ac445bb6af7",
"channel_point": "f5c6598c5ad95bdd7335eeb2ec8f8cda4829d7bdb974447216edfc8f3c3df9ee:1",
"capacity": "3000000",
"local_balance": "2998914",
"remote_balance": "0"
},
"limbo_balance": "2998914"
}
]
{
"channel": {
"remote_node_pub": "0332052748755d74b3395b91eaea78b53bd64b55eb031ccb6a7ae23ac445bb6af7",
"channel_point": "f5c6598c5ad95bdd7335eeb2ec8f8cda4829d7bdb974447216edfc8f3c3df9ee:1",
"capacity": "3000000",
"local_balance": "2998914",
"remote_balance": "0"
},
"closing_txid": "e0eb8dbca98a908d73f8f269bf53c0b67cb0eb09f76110de44f6b349352a1238",
"limbo_balance": "2998914",
"maturity_height": 561058,
"blocks_til_maturity": 360,
"recovered_balance": "0",
"pending_htlcs": [
]
}
"total_limbo_balance": "6753308",
So that's 12488381 Satoshi. I'm still down to 0.12 BTC from the 0.3 I thought I had. If I can extract that limbo balance!
Let's look at one of the "pending_force_closing_channels"
{
"channel": {
"remote_node_pub": "020d41c5a32f06d7addc7378f2d4a6596358d8716a3eb5d5bbdd894a82a1fdd00c",
"channel_point": "9cebba83a510e9b2d52bbaeb9986b9e57ba86ff7adec1310c6afda253334a408:0",
"capacity": "58000",
"local_balance": "602",
"remote_balance": "0"
},
"closing_txid": "bcec52500748200ed0848ddfad1e9ed30f7ae1c552c528bbd9da69d52a291f59",
"limbo_balance": "602",
"maturity_height": 542671,
"blocks_til_maturity": -18027,
"recovered_balance": "0",
"pending_htlcs": [
]
},
listchaintxns | grep bcec52500748200ed0848ddfad1e9ed30f7ae1c552c528bbd9da69d52a291f59
{
"tx_hash": "e0eb8dbca98a908d73f8f269bf53c0b67cb0eb09f76110de44f6b349352a1238",
"amount": "0",
"num_confirmations": 1,
"block_hash": "00000000000000000024a0303bb5e46bfcee93fb352b177136b04b7d618c8a4b",
"block_height": 560698,
"time_stamp": "1548809395",
"total_fees": "0",
"dest_addresses": [
"bc1qnc39p44v0sxxuxhaf26xqf8lry3s6mg3gu9nrrdw5uclwp5rnarqtq73ze"
]
}
Hello man, did you start your node with an LND < 0.5 ?
I had the same problems months ago but unfortunately I didn't find a way to recover my balance and some funds were lost.
I started 3 new nodes with LND 0.5.1 and I had no more of these problems
If you have to destroy your old node maybe you can have back your funds using some services like zigzag.io
I started this node pre 0.4-beta. A long time ago!
They fixed some bugs which caused the problems, but sadly I think those funds are locked up forever. It looks like the private keys were not saved to the DB.
I hope you didn't lose much!
I've started a fresh new node now.
You're a great pioneer man!
I lost 200 dollars locked up forever. It's a great amount if you think whar evolution can have Bitcoin.
However running lnd 0.5.1 with a fresh node is the best solution.
Good luck and thanks for your feedback!