I'm on LND 0.4 alpha. I am unable to close some of my open channels. I can close others. But most of them come up with 'channel not found'. I don't want to close all of my channels (especially not the incoming ones), I just want to close a few and open larger ones. This issue is preventing me from doing that.
$ l listchannels |grep 46b4e0857d27d14d8 -B3 -A15
{
"active": true,
"remote_pubkey": "02f6725f9c1c40333b67faea92fd211c183050f28df32cac3f9d69685fe9665432",
"channel_point": "46b4e0857d27d14d88ef0ea3288ce3c6d4c9d3da714c51e3a97eb2f7116e1089:1",
"chan_id": "565917535315951617",
"capacity": "300000",
"local_balance": "79581",
"remote_balance": "219694",
"commit_fee": "725",
"commit_weight": "724",
"fee_per_kw": "1000",
"unsettled_balance": "0",
"total_satoshis_sent": "219694",
"total_satoshis_received": "0",
"num_updates": "118",
"pending_htlcs": [
],
"csv_delay": 144
},
$ l closechannel 46b4e0857d27d14d88ef0ea3288ce3c6d4c9d3da714c51e3a97eb2f7116e1089
[lncli] rpc error: code = Unknown desc = channel with chan_id=89106e11f7b27ea9e3514c71dad3c9d4c6e38c28a30eef884dd1277d85e0b446 not found
$ l closechannel 565917535315951617
[lncli] rpc error: code = Unknown desc = channel with chan_id=1716951553531759560000000000000000000000000000000000000000000000 not found
Not even forced:
$ l closechannel 46b4e0857d27d14d88ef0ea3288ce3c6d4c9d3da714c51e3a97eb2f7116e1089 --force
[lncli] rpc error: code = Unknown desc = unable to find channel
That error message "channel with chan_id=* not found" is very misleading because there is an actual chan_id property in the channel listings but that's not what closechannel needs. I've closed channels before successfully using the TXID from the channel opening (named channel_point). I wouldn't mind it if closechannel accepted the chan_id as a parameter also.
There is one piece of clue which I suspect may explain why this is happening. In the logs I see:
2018-04-03 06:31:01.792 [ERR] RPCS: [closechannel] unable to close ChannelPoint(46b4e0857d27d14d88ef0ea3288ce3c6d4c9d3da714c51e3a97eb2f7116e1089:0): channel with chan_id=89106e11f7b27ea9e3514c71dad3c9d4c6e38c28a30eef884dd1277d85e0b446 not found
Notice that in the error message, ChannelPoint is the TXID I provided but with a :0 end. The actual channel opening is described with :1 at the end when I do listchannels. But when I try to clarify it, lnd refuses the parameter:
$ l closechannel 46b4e0857d27d14d88ef0ea3288ce3c6d4c9d3da714c51e3a97eb2f7116e1089:1
[lncli] rpc error: code = Unknown desc = max hash string length is 64 bytes
Any suggestions?
The second positional argument to closechannel is the output index. So you would actually need to pass it as:
lncli closechannel 46b4e0857d27d14d88ef0ea3288ce3c6d4c9d3da714c51e3a97eb2f7116e1089 1
Or using keyword arguments:
lncli closechannel --funding_txid=46b4e0857d27d14d88ef0ea3288ce3c6d4c9d3da714c51e3a97eb2f7116e1089 --output_index=1
D'oh. Thanks for the clarification. I can't believe I missed that.
I still recommend changing the error message to not reference chan_id if that isn't used as an argument.
Most helpful comment
The second positional argument to
closechannelis the output index. So you would actually need to pass it as: