[Lightning] Cannot open channels. LND says i have 0 balance

Hello, i am kindly asking help to troubleshoot this issue with lnd LTC mainnet.
I have 0.39 LTC on my wallet, but lnd gives me this error when i try to open a channel:

2020-09-03 02:00:32.288 [INF] UTXN: Attempting to graduate height=1905808: num_kids=0, num_babies=0
2020-09-03 02:00:40.877 [INF] FNDG: Initiating fundingRequest(local_amt=0.0002 BTC (subtract_fees=false), push_amt=0 mSAT, chain_hash=12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2, peer=02fadef5a8a223d2bd693c50ff64deceb7e09938f0695080771c21ec802190f011, dust_limit=0.000546 BTC, min_confs=1)
2020-09-03 02:00:41.181 [INF] CHFD: Performing funding tx coin selection using 253 sat/kw as fee rate
2020-09-03 02:00:41.181 [ERR] RPCS: unable to open channel to NodeKey(02fadef5a8a223d2bd693c50ff64deceb7e09938f0695080771c21ec802190f011): not enough witness outputs to create funding transaction, need 0.0002 BTC only have 0 BTC available
2020-09-03 02:00:41.181 [ERR] RPCS: [/lnrpc.Lightning/OpenChannelSync]: not enough witness outputs to create funding transaction, need 0.0002 BTC only have 0 BTC available

These are my UTXOs:

listunspent
[
{
“txid”: “363e11552e174513ecaf0389a3d7282ce1b15ad19d7518b59c263f076ec0eb6d”,
“vout”: 0,
“address”: “ltc1qwugq9hs57d0ls3svls02aqq29n3ym5ye8aej0a”,
“label”: “”,
“scriptPubKey”: “0014771002de14f35ff8460cfc1eae800a2ce24dd099”,
“amount”: 0.39199925,
“confirmations”: 11,
“spendable”: true,
“solvable”: true,
“desc”: “wpkh([3b195a86/0’/0’/68’]03d2c6a2eee14834a716623c6cf8626490a7a64b25bc4a9cf147450cc8f11837e0)#27alumyg”,
“safe”: true
}
]

What is going wrong here? I have no wallets running other than Litecoin Core, so i am sure lnd was talking to the right wallet

Are you using lndltc? It’s a fork of lnd by the LTCFoundation. Lnd is known to have random issues regarding LTC, and that’s why we’re maintaining this fork: https://github.com/ltcsuite/lnd/releases/tag/v0.11.0-beta.rc1

Can you try using lndltc and get back?

1 Like

Hi thanks.
First, is it possible to release binaries of it? I am using Windows and it would be more comfy. Otherwise i will try compiling it

Anyway the problem was that i did not deposit coins to the lnwallet.
Now i have put 500k litoshi on lnwallet, but when i call openchannel i am getting another error , this time about excessive “reserve capacity”. I have tried with 2 different peers.

IMO it’s because the “funding transaction” is, in this case, 500k litoshi which is too much ? I think the refunding tx that determines my channel capacity is going to be this one:

listchaintxns
{
“transactions”: [
{
“tx_hash”: “c2a0232ee0013f89e040cf3a73aa44a8a954c4ea8d733927cdda96a282fa28d0”,
“amount”: “500000”,
“num_confirmations”: 99,
“block_hash”: “227c6238fa8bf57d2618b12cfb9371e12650a50f4268077d973d973f2e0081e8”,
“block_height”: 1906213,
“time_stamp”: “1599144968”,
“total_fees”: “0”,
“dest_addresses”: [
“ltc1qe8vtjlcvy6du9hc4ez2avxpkqlw5jk93s0wy3c”,
“ltc1qdmfyk77d4gkl5qgzs3tpqlmv20w8qntur23hkq”
],
“raw_tx_hex”: “020000000001016debc06e073f269cb518759dd15ab1e12c28d7a38903afec1345172e55113e360000000000feffffff0220a1070000000000160014c9d8b97f0c269bc2df15c895d6183607dd4958b1137e4e02000000001600146ed24b7bcdaa2dfa01028456107f6c53dc704d7c02473044022055c8d239609c9dd218aac442b2654e92d34792ef7f951bb10467361d58f52c2102203ccaa6faa780838141afe73b197e2dc0d89b09dca7f6dfdf13836095736dae4b012103d2c6a2eee14834a716623c6cf8626490a7a64b25bc4a9cf147450cc8f11837e024161d00”,
“label”: “”
}
]
}

But it seems to be just the deposit tx to fund the lnwallet. Is the capacity determined by it, or is it only determined by the “commit amount” passed to openchannel ? So if i commit just 20000 litoshi, my capacity is just 20000 even if my available balance is 500k ?

The error in question was:

[[error] => received funding error from 03a00329856d57deaad0ccfec89bcc4bcb67854832ad053857c4ad791862e04f26: chan_id=5966f7a8f4abef9d5122fe73d909929bfd13facaadcba02ff480ecdd417aa601, err=channel reserve is too large: 54600 sat, max is 4000 sat, [code] => 2, [message] => received funding error from 03a00329856d57deaad0ccfec89bcc4bcb67854832ad053857c4ad791862e04f26: chan_id=5966f7a8f4abef9d5122fe73d909929bfd13facaadcba02ff480ecdd417aa601, err=channel reserve is too large: 54600 sat, max is 4000 sat, [details] => []]

And the call parameters:

{“node_pubkey_string”:“03a00329856d57deaad0ccfec89bcc4bcb67854832ad053857c4ad791862e04f26”,“target_conf”:2,“local_funding_amount”:20000,“push_sat”:0}

P.S. Another bug but that may be there just for LTC:

lncli --chain=litecoin --network=mainnet sendcoins --addr=ltc1q0vrwyc7sh836hp0j9mpj752fhm649ta45gzjuc --sweepall --sat_per_byte=1
[lncli] rpc error: code = Unknown desc = decoded address is of unknown format

I think lnd expects it to be a BTC address, so i will try ltc-lnd fork for this one

That error message is just hard to decipher. This person had the same issue, and describes the solution in their reply: https://github.com/lightningnetwork/lnd/issues/2142

The other bug is known, and is one of the things the lndltc fork solves. Unfortunately I don’t think I can build windows binaries for upload at the moment, but if you don’t mind I can upload something in a min here only

1 Like

Would be great

I cannot even connect to peers via REST.

curl_setopt($this->_curl, CURLOPT_URL, $uri);
// $uri is https://localhost:8080/v1/peers


curl_setopt($this->_curl, CURLOPT_POSTFIELDS, $body);
/*
$body is   
 {"addr":"03a00329856d57deaad0ccfec89bcc4bcb67854832ad053857c4ad791862e04f26@a4d3stieqqauh54u5yotv4io5xzeqsnhkqa3jdvkhlespms4nhrhg4id.onion:10735","perm":false}

The response i get:

HTTP/1.1 400 Bad Request
Content-Type: application/json
Date: Thu, 03 Sep 2020 15:05:21 GMT
Content-Length: 203
Connection: close

{
"error": "json: cannot unmarshal string into Go value of type map[string]json.RawMessage",
"code":3,
"message":"json: cannot unmarshal string into Go value of type map[string]json.RawMessage",
"details":[]
}
    */

I really don’t understand what’s wrong with my call.
I am sure it’s not a problem with the HTTP headers but just the body of the call, because i tried other calls via REST like /v1/channels and it doesn’t give this kind of error , which seems about json syntax

Here are the binaries: https://drive.google.com/drive/folders/1RClhx06hc1yqCa5_EmJRz41BweC02YSW?usp=sharing

I am sorry to say that i am still getting both errors ( opening a channel and connecting to a peer via REST ).

2020-09-04 00:28:14.349 [INF] LTND: Version: 0.11.0-beta.rc1 commit=clock/v1.0.0-388-g1a001cbb895af6433f02735b281462b25adb0b50, build=production, logging=default
2020-09-04 00:28:14.350 [INF] LTND: Active chain: Litecoin (network=mainnet)
2020-09-04 00:28:14.350 [INF] LTND: Opening the main database, this might take a few minutes...
2020-09-04 00:28:14.350 [INF] LTND: Opening bbolt database, sync_freelist=false
2020-09-04 00:28:14.357 [INF] CHDB: Checking for schema update: latest_version=17, db_version=17
2020-09-04 00:28:14.361 [INF] LTND: Database now open (time_to_open=10.9681ms)!
2020-09-04 00:28:14.363 [INF] RPCS: Generating TLS certificates...
2020-09-04 00:28:14.387 [INF] RPCS: Done generating TLS certificates

This is the log for the channel creation problem:

2020-09-04 01:30:55.476 [INF] FNDG: Initiating fundingRequest(local_amt=0.0002 BTC (subtract_fees=false), push_amt=0 mSAT, chain_hash=12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2, peer=0211eeda84950d7078aa62383c7b91def5cf6c5bb52d209a324cda0482dbfbe4d2, dust_limit=0.000546 BTC, min_confs=1)
2020-09-04 01:30:55.793 [INF] CHFD: Performing funding tx coin selection using 253 sat/kw as fee rate
2020-09-04 01:30:55.829 [INF] FNDG: Target commit tx sat/kw for pendingID(9f282db1b1568f0f5c8082f1730bdce7a4d82c3d74b0470f530d2ef6112514ce): 253
2020-09-04 01:30:55.829 [INF] FNDG: Starting funding workflow with 178.128.97.48:21002 for pending_id(9f282db1b1568f0f5c8082f1730bdce7a4d82c3d74b0470f530d2ef6112514ce), committype=tweakless
2020-09-04 01:30:57.181 [INF] CRTR: Pruning channel graph using block 1590d55cbf552f8adcf26445e8336f25a3fbc8581720372cb170a6895757d546 (height=1906410)
2020-09-04 01:30:57.187 [INF] CRTR: Block 1590d55cbf552f8adcf26445e8336f25a3fbc8581720372cb170a6895757d546 (height=1906410) closed 0 channels
2020-09-04 01:31:00.835 [INF] NTFN: New block: height=1906410, sha=1590d55cbf552f8adcf26445e8336f25a3fbc8581720372cb170a6895757d546
2020-09-04 01:31:00.835 [INF] UTXN: Attempting to graduate height=1906410: num_kids=0, num_babies=0
2020-09-04 01:31:05.565 [INF] SRVR: Established connection to: 027c2986cd45217cd8c996555f4f0925fc01b3030cebfa6d59e90e230bb00b3a8b@2h75mpnfjedkceervapn3ntb4rh6ugv5uxx2xkvcqiz6yuoghlsaglyd.onion:9735
2020-09-04 01:31:05.565 [INF] SRVR: Finalizing connection to 027c2986cd45217cd8c996555f4f0925fc01b3030cebfa6d59e90e230bb00b3a8b@2h75mpnfjedkceervapn3ntb4rh6ugv5uxx2xkvcqiz6yuoghlsaglyd.onion:9735, inbound=false
2020-09-04 01:31:06.847 [INF] PEER: Negotiated chan series queries with 027c2986cd45217cd8c996555f4f0925fc01b3030cebfa6d59e90e230bb00b3a8b
2020-09-04 01:31:06.847 [INF] DISC: Creating new GossipSyncer for peer=027c2986cd45217cd8c996555f4f0925fc01b3030cebfa6d59e90e230bb00b3a8b
2020-09-04 01:31:39.644 [INF] CRTR: Processed channels=64 updates=110 nodes=31 in last 2m3.1858801s
2020-09-04 01:31:57.460 [INF] DISC: Attempting to bootstrap with: Authenticated Channel Graph
2020-09-04 01:31:57.460 [INF] DISC: Obtained 2 addrs to bootstrap network with
2020-09-04 01:31:57.857 [ERR] SRVR: Unable to connect to 02e1d17b0dda809aa8b0e1c788ce3fef4ea3728a8d77c3684bb9fc2453457dbc66@188.226.138.177:9735: socks connect tcp 127.0.0.1:9150->188.226.138.177:9735: unknown error connection refused
2020-09-04 01:31:57.857 [ERR] SRVR: Unable to connect to 02e1d17b0dda809aa8b0e1c788ce3fef4ea3728a8d77c3684bb9fc2453457dbc66@188.226.138.177:9735: socks connect tcp 127.0.0.1:9150->188.226.138.177:9735: unknown error connection refused
2020-09-04 01:31:58.405 [INF] SRVR: Established connection to: 02f39909d1876e1598995f173d0053622c7b593af7e8357e6b87a4c8bfe7b5c81a@18.209.90.218:9735
2020-09-04 01:31:58.406 [INF] SRVR: Finalizing connection to 02f39909d1876e1598995f173d0053622c7b593af7e8357e6b87a4c8bfe7b5c81a@18.209.90.218:9735, inbound=false
2020-09-04 01:31:58.927 [INF] PEER: Negotiated chan series queries with 02f39909d1876e1598995f173d0053622c7b593af7e8357e6b87a4c8bfe7b5c81a
2020-09-04 01:31:58.927 [INF] DISC: Creating new GossipSyncer for peer=02f39909d1876e1598995f173d0053622c7b593af7e8357e6b87a4c8bfe7b5c81a
2020-09-04 01:32:39.640 [INF] CRTR: Processed channels=62 updates=109 nodes=14 in last 59.9964884s
2020-09-04 01:32:46.902 [INF] CRTR: Pruning channel graph using block 3917d2c98e840614b255f9627a416eafba38993e6033ee736598989cbd040e7b (height=1906411)
2020-09-04 01:32:46.909 [INF] CRTR: Block 3917d2c98e840614b255f9627a416eafba38993e6033ee736598989cbd040e7b (height=1906411) closed 0 channels
2020-09-04 01:32:50.352 [INF] NTFN: New block: height=1906411, sha=3917d2c98e840614b255f9627a416eafba38993e6033ee736598989cbd040e7b
2020-09-04 01:32:50.352 [INF] UTXN: Attempting to graduate height=1906411: num_kids=0, num_babies=0
2020-09-04 01:32:59.035 [ERR] SRVR: Unable to connect to 02b92c955ea18dd5a4ea23769a1b6bd9b3ab4b3258ba3eb2e09da1ca5f4a77380b@62.169.185.241:9736: socks connect tcp 127.0.0.1:9150->62.169.185.241:9736: unknown error general SOCKS server failure
2020-09-04 01:33:06.501 [INF] FNDG: Cancelling funding reservation for node_key=0211eeda84950d7078aa62383c7b91def5cf6c5bb52d209a324cda0482dbfbe4d2, chan_id=9f282db1b1568f0f5c8082f1730bdce7a4d82c3d74b0470f530d2ef6112514ce
2020-09-04 01:33:06.502 [ERR] FNDG: received funding error from 0211eeda84950d7078aa62383c7b91def5cf6c5bb52d209a324cda0482dbfbe4d2: chan_id=9f282db1b1568f0f5c8082f1730bdce7a4d82c3d74b0470f530d2ef6112514ce, err=Channel reserve is too large: 54600 sat, max is 4000 sat
2020-09-04 01:33:06.503 [ERR] RPCS: unable to open channel to NodeKey(0211eeda84950d7078aa62383c7b91def5cf6c5bb52d209a324cda0482dbfbe4d2): received funding error from 0211eeda84950d7078aa62383c7b91def5cf6c5bb52d209a324cda0482dbfbe4d2: chan_id=9f282db1b1568f0f5c8082f1730bdce7a4d82c3d74b0470f530d2ef6112514ce, err=Channel reserve is too large: 54600 sat, max is 4000 sat
2020-09-04 01:33:06.504 [ERR] RPCS: [/lnrpc.Lightning/OpenChannelSync]: received funding error from 0211eeda84950d7078aa62383c7b91def5cf6c5bb52d209a324cda0482dbfbe4d2: chan_id=9f282db1b1568f0f5c8082f1730bdce7a4d82c3d74b0470f530d2ef6112514ce, err=Channel reserve is too large: 54600 sat, max is 4000 sat

I don’t know if this is relevant. Before testing this version, i have created a new wallet by importing the seed from the other lnd.
After syncing my balance has been restored correctly

p.s. For the channel creation, i will try committing 5M Litoshis and i will be back. Maybe that’s the trick.
About the peer connection problem, i still don’t know what to try

UPDATE: channel creation worked now with 5M litoshi commitment.

1 Like

UPDATE: the “connect” call works now. I was passing the “addr” field as a string, but it should be a struct with 2 fields: pubkey and host

1 Like

whoops myfault wasn’t looking at your log properly enough