Skip to content

After opening the channel, the node balance is lost #8251

@liuyinta

Description

@liuyinta

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

./lncli closechannel --funding_txid=3bdbaf268a743727b23ec4df241d3a5b70601605621e8c7f4ec31faf4e59c2df --output_index=1
{
"closing_txid": "a1710f294c65a628d34a00f3bd42675e038770bdb2422da7396235a2b71cbb0f"
}
[root@eb7e346f7884 lnd]# ./lncli closechannel --funding_txid=d2935b0d2958beb4d876a2c5f39faf24bcd74f1bdb6584dcaf6638df234755ca --output_index=1
{
"closing_txid": "8397d5c2821a32085b503d93788f02a48e91aa63cdac3d182e80884dc99e66ae"
}
[root@eb7e346f7884 lnd]# ./lncli closechannel --funding_txid=43b4aabec2749fb54a6534985eec30c1cd33e7bb6c4f10f04bedfafad05fde10 --output_index=1
{
"closing_txid": "62e6472be147d5f8ba1aae6bccdb7aeef7a06d4822b30d8d4584cbb5062db207"
}
[root@eb7e346f7884 lnd]# ./lncli closechannel --funding_txid=231e7290c9fbd7248207c2984564a34c4bcc4f91fa5fbfd5a1d5f51fd5d2ad4e --output_index=1
{
"closing_txid": "80f3a78317f97a894e3d0cfd6089adbb62ce6528213d58c7ccf60ae4192bc99b"
}
[root@eb7e346f7884 lnd]# ./lncli closechannel --funding_txid=7ad753f3321b3105be779bf4ceb50fe405b0295dd392e312bdf71eb93f54302f --output_index=1
{
"closing_txid": "754886ad752ef9e157e28a71282cc210e6a9c393b0696c6e83cf8d5ca66948cd"
}

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

./lncli openchannel --local_amt=500000000 --node_key=034ea80f8b148c750463546bd999bf7321a0e6dfc60aaf84bd0400a2e8d376c0d5

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

./lncli openchannel --private --local_amt=500000000 --node_key=03cabeaa1223b83d56954e944e83493d20c6b2c9b45e47b62a899ab9d7d31cb56d
{
"funding_txid": "c588e86f2d29b3c4e0951e321b53716ddc84cd77c611b05e74496e6cc4f7ff1a"
}
[root@eb7e346f7884 lnd]# ./lncli openchannel --private --local_amt=500000000 --node_key=03cabeaa1223b83d56954e944e83493d20c6b2c9b45e47b62a899ab9d7d31cb56d
./lncli openchannel --private --local_amt=500000000 --node_key=03cabeaa1223b83d56954e944e83493d20c6b2c9b45e47b62a899ab9d7d31cb56d
./lncli openchannel --private --local_amt=500000000 --node_key=03cabeaa1223b83d56954e944e83493d20c6b2c9b45e47b62a899ab9d7d31cb56d
./lncli openchannel --private --local_amt=500000000 --node_key=030a58b8653d32b99200a2334cfe913e51dc7d155aa0116c176657a4f1722677a3
./lncli openchannel --private --local_amt=500000000 --node_key=030a58b8653d32b99200a2334cfe913e51dc7d155aa0116c176657a4f1722677a3
./lncli openchannel --local_amt=500000000 --node_key=030a58b8653d32b99200a2334cfe913e51dc7d155aa0116c176657a4f1722677a3
[lncli] rpc error: code = Unknown desc = received funding error from 03cabeaa1223b83d56954e944e83493d20c6b2c9b45e47b62a899ab9d7d31cb56d: chan_id=e74ab98a556eba61bc987c9061714727bc83f4bf666e9789155a43965ef1faef, err=Number of pending channels exceed maximum
[root@eb7e346f7884 lnd]# ./lncli openchannel --private --local_amt=500000000 --node_key=03cabeaa1223b83d56954e944e83493d20c6b2c9b45e47b62a899ab9d7d31cb56d
./lncli openchannel --private --local_amt=500000000 --node_key=030a58b8653d32b99200a2334cfe913e51dc7d155aa0116c176657a4f1722677a3[lncli] rpc error: code = Unknown desc = received funding error from 03cabeaa1223b83d56954e944e83493d20c6b2c9b45e47b62a899ab9d7d31cb56d: chan_id=d7aae0430698288c23c80c8948da0daf79d76af6c36668b755e2db9c9324be68, err=Number of pending channels exceed maximum
[root@eb7e346f7884 lnd]# ./lncli openchannel --private --local_amt=500000000 --node_key=03cabeaa1223b83d56954e944e83493d20c6b2c9b45e47b62a899ab9d7d31cb56d
[lncli] rpc error: code = Unknown desc = received funding error from 03cabeaa1223b83d56954e944e83493d20c6b2c9b45e47b62a899ab9d7d31cb56d: chan_id=1ae2aa5d4670628baaba29371e7df5610766557acfb0b10d3d8fe31782243f10, err=Number of pending channels exceed maximum
[root@eb7e346f7884 lnd]# ./lncli openchannel --private --local_amt=500000000 --node_key=030a58b8653d32b99200a2334cfe913e51dc7d155aa0116c176657a4f1722677a3
{
"funding_txid": "8504e0f8e59dfb21115d020a842e7f502d08e4948682a7f7091569667e3d768b"
}
[root@eb7e346f7884 lnd]# ./lncli openchannel --private --local_amt=500000000 --node_key=030a58b8653d32b99200a2334cfe913e51dc7d155aa0116c176657a4f1722677a3
{
"funding_txid": "ce76e3bb1dab2994a5c2f77ccbba22e56f9ba98683dbad0d3ab751024e3c1275"
}
[root@eb7e346f7884 lnd]# ./lncli openchannel --local_amt=500000000 --node_key=030a58b8653d32b99200a2334cfe913e51dc7d155aa0116c176657a4f1722677a3
{
"funding_txid": "538f2cae82461d2be43a646b3fdcde37d09955fa7c1d387ae416d29e9f1739bd"
}
[root@eb7e346f7884 lnd]# ./lncli openchannel --private --local_amt=500000000 --node_key=030a58b8653d32b99200a2334cfe913e51dc7d155aa0116c176657a4f1722677a3
[lncli] rpc error: code = Unknown desc = received funding error from 030a58b8653d32b99200a2334cfe913e51dc7d155aa0116c176657a4f1722677a3: chan_id=bff3a46baa209f48fd207b9580134315dd7bd393e39ee1207a1fa827929af656, err=Number of pending channels exceed maximum

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.

address: bc1qdjr4hu53fkknq68m0vd3823gxhzrefhhkykedz balanceOnNode: 0, balanceOnChain: 2049667
address: bc1pujzttnxrrvdpw9kvpf5v3fwnum5gr65qnf5sem4stnvm0pwy05kqlgvmrr balance on node: 0, balance on chain: 197944196
address: bc1p6hjlgjey376hk2ue9hjlmt6x0q0spte7z58gjm8ecj3xmm8updfqctwvem balance on node: 0, balance on chain: 977800
address: bc1pnhaulw39786q5mn2yx7d82epjdaue5n2xgqqs4dn6drz67frgqmshm4f0r balance on node: 0, balance on chain: 494897660
address: bc1pctzseenm2pmrlhv6wud9807f5smq5g92ecqxxyczxmqegltc97kqqhzrk7 balance on node: 0, balance on chain: 7917819
address: bc1p2lhmy7qxtmzuzrjf6r2p5z9awtzn4y842u2clk8l7jkukw7tgussqgdaq6 balance on node: 0, balance on chain: 492734454
address: bc1pp759mhsd64ecnxjuennlu3m4e5gmxpukfpwrgxt7ujnp5guspgwsvwuz39 balance on node: 0, balance on chain: 44535128
address: bc1pgymnykx5rwf7rkger6qvac4f563zq7tad4ha3009r9ytwf9xwf5syj0a4e balance on node: 0, balance on chain: 4945808
address: bc1p24wcv388604frgnwrlnm7z5ughp5kqnfxuey6n0gglkuzfs4d9qq0rmuke balance on node: 0, balance on chain: 494868539
address: bc1pkrsna3504jf8t3wvescd5stzymcaepyh47x5s60a3drjg9njhmystrw4lk balance on node: 0, balance on chain: 494385275

address: bc1pkarchx83dyuzncus48w7mghv03p6y9rgfmppkdj0szhnlznq7fmq5ecqru balance on node: 5931994, balanceOnChain: 0
address: bc1p5jsu6j9jq4zyfxeccal5fvuvxlm2ak6w2s6l638qmxf83nrr2fcseyh3nr balance on node: 2047257, balance on chain: 0
address: bc1p3ltxu26p0jshtlftvq4e4x7c5facv4clhumt22xv3agnlha94eyqgdvtf6 balance on node: 4943463, balance on chain: 0
address: bc1pf85p270fm4d7f0lxv9tjx5qz604g4arx3zwzln9xs3w49ttqayusqmyqej balance on node: 44509285, balance on chain: 0

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnintended code behaviour

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions