Closed liuyinta closed 10 months ago
So your funds are definitely not lost but we need to make your lnd wallet aware of them again.
Generally it's a bad idea to interrupt important lnd rpc calls (for example openchannel
and trying it again without finding the root cause of the problem why this cmd is somehow stuck).
Could you try to broadcast the rawtransaction via the lncli wallet publishtx
for all the transactions you are missing the funds. For example:
address: bc1pnhaulw39786q5mn2yx7d82epjdaue5n2xgqqs4dn6drz67frgqmshm4f0r balance on node: 0, balance on chain: 494897660
Do:
lncli wallet publishtx 020000000001021fae4d1ef4d3e6177ea97f361054aac0bc491843939dd3142f0eb1299bc1a817000000000000000000dc43d7336aaca9c4013107a2ad2fee97a8b377061f8055eb06b3dfacaa2238eb01000000000000000001fc897f1d000000002251209dfbcfba25f1f40a6e6a21bcd3ab21937bccd26a32000855b3d3462d79234037024830450221009a1289b846bfee5cfff1bbf9a1a1a19310fbe873cc635d9154aa2135e291d69402201f18214fad85de6a4ca3ef26f2f1c5dafecb994945fe536f5761e8b9eb35be170128210276c4d3567a91c230c96c0abc26a95336bbd09efb2cb69ffec625ac2687c30897ac736460b2680140afa5ec980518ab60d8fccd73fd009a8ed04487b288feeffec6ac01c1db82045dc38f725e2266a2d30fef6f0ab78a860d42925bcc8c804a9f6050ec975331482a70820c00
See whether the following utxo shows up in the lncli listunspent | grep a9cf392047a5b946f9e1b5a835815157860ddb4b663c49044ecaf4fb5614d6cd:0
In addition it would be very helpful if you could provide your logs via lnd slack or another private way
why lnd was struggling opening the channel.
Can you fill out the rest of the issue template? eg: which lnd
version are you running?
Do you see any pending open channels in lncli pendingchannels
?
I'm not sure this is related, but wanted to share my experience with something similar: Running v0.17.2-beta
, during my last few attempts to open channels, in every case it seems that LND ended up mis-counting my onchain balance.
Yesterday, I tried a lncli batchopenchannel
with about 6 or 8 nodes... after waiting a bit, I saw that lncli pendingchannels
didn't show any pending channels, and the batchopenchannel
command was just "hanging" (not returning) in the console and I force-quit it after an hour or so. At the beginning of the opening, I did seem messages in the LND logs like:
lnd-lnd-1 | 2023-12-15 23:19:48.281 [ERR] FNDG: received funding error from [redacted]: chan_id=[redacted], err=Number of pending channels exceed maximum
My understanding is that one channel failure like this will stop the entire BatchOpenChannel process (as is documented here: https://lightning.engineering/api-docs/api/lnd/lightning/batch-open-channel/index.html ). So after an hour I assumed that the BatchOpen failed.
I then wanted to check-in on my onchain balance, so I ran
:/$ lncli walletbalance
{
"total_balance": "0",
"confirmed_balance": "0",
"unconfirmed_balance": "0",
"locked_balance": "0",
"reserved_balance_anchor_chan": "100000",
"account_balance": {
"default": {
"confirmed_balance": "0",
"unconfirmed_balance": "0"
}
}
}
Which was somewhat scary. So then I restarted LND, and everything reverted and my on-chain balance came back.
I then decided that there were too many unknowns with the BatchOpenChannel command, so I opened a few channels one-by-one. The channel openings succeeded, I found them as pending, but then I looked again at lncli walletbalance
, and once again this showed 0
total balance.
And then again, when I restarted LND, the balances came back.
I have a similar issue with openchannel
. It is hanging, the channel doesn't show up in lncli pendingchannels
, the balance is 0 in walletbalance
.
The whole story, including some details, which may be important.
Originally I had this.
$ lncli walletbalance
{
"total_balance": "1381855",
"confirmed_balance": "735444",
"unconfirmed_balance": "646411",
"locked_balance": "0",
"reserved_balance_anchor_chan": "100000",
"account_balance": {
"default": {
"confirmed_balance": "735444",
"unconfirmed_balance": "646411"
}
}
}
unconfirmed_balance is caused by an old anchor sweep tx which spends anchor output and one of wallet's UTXOs and produces another wallet utxo. By the way, the transaction itself reduced my wallet balance and was economically meaningless. Its fee rate was quite high, but it didn't confirm in time and went below purging limit according to mempool.space.
Later I restarted the node and saw, that the balance is fully confirmed:
$ lncli walletbalance
{
"total_balance": "1384283",
"confirmed_balance": "1384283",
"unconfirmed_balance": "0",
"locked_balance": "0",
"reserved_balance_anchor_chan": "100000",
"account_balance": {
"default": {
"confirmed_balance": "1384283",
"unconfirmed_balance": "0"
}
}
}
Probably it forgot about the anchor sweep transaction, which is a good thing.
I decided to open a channel and openchannel
got stuck. It is still stuck. Here is the command and relevant parts of the log.
$ lncli openchannel --fee_rate_ppm **** --sat_per_vbyte 70 --fundmax ***
2024-01-02 04:37:11.802 [INF] FNDG: Initiating fundingRequest(local_amt=0 BTC (subtract_fees=false), push_amt=0 mSAT, chain_hash=000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce
26f, peer=***, min_confs=1)
2024-01-02 04:37:11.933 [INF] CHFD: Performing funding tx coin selection using 17500 sat/kw as fee rate
2024-01-02 04:37:12.103 [WRN] CHFD: Unable to find funding output for shim intent: unable to create witness script, no funding keys
2024-01-02 04:37:12.387 [INF] FNDG: Target commit tx sat/kw for pendingID(47f419bcab6ce0da34dd453fb9afa0fc48e15da19c574815acfcda8557f772e2): 2500
2024-01-02 04:37:12.387 [INF] FNDG: Dust limit for pendingID(47f419bcab6ce0da34dd453fb9afa0fc48e15da19c574815acfcda8557f772e2): 0.00000354 BTC
2024-01-02 04:37:12.387 [INF] FNDG: Starting funding workflow with ***:9735 for pending_id(47f419bcab6ce0da34dd453fb9afa0fc48e15da19c574815acfcda8557f772e2), committype=anchors-zero-fee-second-level
2024-01-02 04:47:39.600 [WRN] FNDG: reservation timed out waiting for peer (peer_id:***, chan_id:47f419bcab6ce0da34dd453fb9afa0fc48e15da19c574815acfcda8557f772e2)
2024-01-02 04:47:42.972 [INF] CRTR: Examining channel graph for zombie channels
2024-01-02 04:47:43.204 [INF] CRTR: Pruning 1 zombie channels
2024-01-02 04:47:43.255 [INF] CHDB: Pruned unconnected node yyy [unrelated node] from channel graph
2024-01-02 04:47:43.256 [INF] CHDB: Pruned 1 unconnected nodes from the channel graph
2024-01-02 04:47:46.441 [INF] CRTR: Processed channels=0 updates=91 nodes=27 in last 59.999399041s
Channel opening is still stuck, wallet balance is 0.
$ lncli walletbalance
{
"total_balance": "0",
"confirmed_balance": "0",
"unconfirmed_balance": "0",
"locked_balance": "0",
"reserved_balance_anchor_chan": "100000",
"account_balance": {
"default": {
"confirmed_balance": "0",
"unconfirmed_balance": "0"
}
}
}
Maybe if I restart the node, it will recover the balance, but I better wait.
Update. lncli openchannel
exited:
[lncli] rpc error: code = Unknown desc = peer disconnected
and the wallet balance recovered!
The openchannel
and "funds disappearing" issue might be related to #8362.
I think we can close this as a duplicate of: https://github.com/lightningnetwork/lnd/issues/7868
It might be, but I would say this issue here ties more to the fix here: https://github.com/lightningnetwork/lnd/pull/8367
Because I think the main problem here is that the peer does disrupt the communication whereas in https://github.com/lightningnetwork/lnd/issues/7868 the funding flow works fine but it only fails because the funding tx cannot be broadcasted on our end.
So I would keep those two issues distinct but maybe @hieblmi can verify ?
@ziggie1984 shouldn't the coins be cleaned up either way due to the defer?
I think we can help confirm if any of the other commenters in this list saw the coins in lncli wallet listleases
.
Background
After closing some channels, we attempted to establish multiple channels with three nodes. After the establishment was completed, there was a discrepancy between the balance query on the node and the balance on the chain. The following is the specific situation
Actual behaviour
At the beginning, we closed the opening of six channels with LNBiG Hub
Then we tried to establish a channel. But when executing this command, we still get no result, so we forcibly interrupted it, and then restarted the node
After restarting the node, we tried to execute the above command again. it still got no result, so we forcibly interrupted it again Then we tried to establish channels with the other two nodes. The specific implementation results are as follows
Sometimes the command can work, but sometimes it has always been blocked, so we force the interrupt of this command every time According to the above execution results, It take us 20 btc to open channel but we found our wallet amount has decreased by 40 btc. We don't know where 20 BTC left off, This is wallet balance now, just 17.3 btc, but before we execute that command ,we have 51 btc. And channel balance is right, now we have 174 btc, before execute amount is 152 btc.
We checked the balance of all our addresses on the chain and on the node. These addresses are different.
Please help us find out what the problem is, and help us find the lost 20 btc or fix the balance on node, And the reason for getting no result also needs to be found Thank you so much.