Lightning: Did I lose some BTC Funding a Channel to LND?

Created on 25 Sep 2018  路  10Comments  路  Source: ElementsProject/lightning

Issue and Steps to Reproduce

I am running c-lightning on BTCpayserver. I just setup an LND node on a different BTCpay Server instance. I attempted to open a channel between my two nodes from the c-lightning node.

List funds before opening channel,

root@BTCPayServerVM:~# bitcoin-lightning-cli.sh listfunds
{
  "outputs": [
    {
      "txid": "a6c1f6050d1687a0e4fb371f24be538de41db1b06d2e79164723ff1471ffe80e"                            ,
      "output": 0,
      "value": 227265,
      "address": "bc1qfsk2w6h8v6pdwgm4pu6pg69a9zn9w02c8rmsgc",
      "status": "confirmed"
    },
    {
      "txid": "e15141901773b04828d1e1de53da826eb3165140f3aab2d5e456c42d640401c6"                            ,
      "output": 0,
      "value": 298896,
      "address": "bc1qzrnxlmrwt57zn7pkt6r8u3pzx4f26nlqnnd6yt",
      "status": "confirmed"
    }

When I tried to connect everything seemed to be working as normal,

root@BTCPayServerVM:~# bitcoin-lightning-cli.sh connect 0319fec13dcb6df5b6a0cee49e85b4f6c48e5387d62d67858d6d46615b6e683f81@170.75.175.204:9735
{
  "id": "0319fec13dcb6df5b6a0cee49e85b4f6c48e5387d62d67858d6d46615b6e683f81"
}

I then attempted to fund the channel and it did nothing. It just stalled and sat there for quite a while.

root@BTCPayServerVM:~# bitcoin-lightning-cli.sh fundchannel 0319fec13dcb6df5b6a0cee49e85b4f6c48e5387d62d67858d6d46615b6e683f81 all

I canceled the command with ^C after a bit, that may have been a bad idea... When i checked the funds after, they had moved. But i don't see a new channel and neither does my other node...

root@BTCPayServerVM:~# bitcoin-lightning-cli.slistfunds
{
  "outputs": [
  ],
  "channels": [
    {

Any assistance is appreciated!

{
"id": "036dc6c5fc1a16171f182f48794cf3833654e8018cce0bde540854b19854448f5f",
"alias": "Corbimos",
"color": "036dc6",
"address": [
{
"type": "ipv4",
"address": "23.100.30.211",
"port": 9735
}
],
"binding": [
{
"type": "ipv4",
"address": "0.0.0.0",
"port": 9735
}
],
"version": "0abbfd0-modded",
"blockheight": 542940,
"network": "bitcoin"
}

lnd-compat question

All 10 comments

Ahh, No i did not!

When i list peers i can see the tx,


 {
      "id": "0319fec13dcb6df5b6a0cee49e85b4f6c48e5387d62d67858d6d46615b6e683f81", 
      "connected": false, 
      "channels": [
        {
          "state": "ONCHAIN", 
          "owner": "lightning_onchaind", 
          "short_channel_id": "542901:785:0", 
          "channel_id": "4a14fb77050a9eb18e86f6f7e3bbdcc370a8d1e00a0937754d95f62242e50caf", 
          "funding_txid": "af0ce54222f6954d7537090ae0d1a870c3dcbbe3f7f6868eb19e0a0577fb144a", 
          "msatoshi_to_us": 525679000, 
          "msatoshi_to_us_min": 525679000, 
          "msatoshi_to_us_max": 525679000, 
          "msatoshi_total": 525679000, 
          "dust_limit_satoshis": 546, 
          "max_htlc_value_in_flight_msat": 18446744073709551615, 
          "their_channel_reserve_satoshis": 5257, 
          "our_channel_reserve_satoshis": 5256, 
          "spendable_msatoshi": 520423000, 
          "htlc_minimum_msat": 0, 
          "their_to_self_delay": 144, 
          "our_to_self_delay": 144, 
          "max_accepted_htlcs": 483, 
          "status": [
            "CHANNELD_AWAITING_LOCKIN:Reconnected, and reestablished.", 
            "CHANNELD_NORMAL:bad reestablish msg: WIRE_ANNOUNCEMENT_SIGNATURES 01034a14fb77050a9eb18e86f6f7e3bbdcc370a8d1e00a0937754d95f62242e50caf0848b500031100000349e10f2eeb2c2960b8c9899d4f29ccada7c58287ad19120d05ba9e64a82c884089c5367ef581bed66285b731a9494eb907431fdcef8174981fe7bd66b46123e19e4ba18f954e9e91dc39c547abef53506666aae9e3ac01f10fcb6926f7a1d71adbb12049df625d383a9a5c241b4f8914c12842a668588f592e73f232da32f6", 
            "ONCHAIN:Tracking our own unilateral close", 
            "ONCHAIN:2 outputs unresolved: in 109 blocks will spend DELAYED_OUTPUT_TO_US (5cfb6bf805501a8feb5b6fb1858f98092cdcde7633d7b206d6c69f35e66e29bf:0) using OUR_DELAYED_RETURN_TO_WALLET"
          ], 
          "in_payments_offered": 0, 
          "in_msatoshi_offered": 0, 
          "in_payments_fulfilled": 0, 
          "in_msatoshi_fulfilled": 0, 
          "out_payments_offered": 0, 
          "out_msatoshi_offered": 0, 
          "out_payments_fulfilled": 0, 
          "out_msatoshi_fulfilled": 0
        }
      ]
    }, 

But for some reason my LND node is showing as not connected... It is up and operating, but i think the issue is on that side.

Update: That LND node seems to see the c-lightning node as a peer just fine, but it does not recognize the channel as active or pending... Any ideas on what might be the issue here?

One of the two ends (I'm guessing your end) decided to close the channel immediately (maybe because it lost the connection and couldn't confirm the channel in time). You'll get your funds back after the unilateral close timeout expires in 109 as the status is showing.

As to why the channel was closed, you'll have to scour the logs to see what happened.

The same issue is happening form the other side too. Tried to open a channel and funds are mia for the moment. I'm sure they'll be back after so many blocks.

My c-lightning will not even connect to my lnd at all anymore. Just sits there when i use the connect.

but lnd sees it as a peer. Can anyone else connect to my lnd node? is the problem there or my c-lightning?

LND node get info.


{
    "identity_pubkey": "0319fec13dcb6df5b6a0cee49e85b4f6c48e5387d62d67858d6d46615b6e683f81",
    "alias": "0319fec13dcb6df5b6a0",
    "num_pending_channels": 0,
    "num_active_channels": 0,
    "num_peers": 5,
    "block_height": 543246,
    "block_hash": "000000000000000000086d026404809dc9a12768701c49ac8f9e6ccad982e277",
    "synced_to_chain": true,
    "testnet": false,
    "chains": [
        "bitcoin"
    ],
    "uris": [
        "0319fec13dcb6df5b6a0cee49e85b4f6c48e5387d62d67858d6d46615b6e683f81@170.75.175.204:9735"
    ],
    "best_header_timestamp": "1538021740",
    "version": "0.4.2-beta commit=53877ce829d13b36a4f0386899437db245b3eeb0"
}

other channels connect just fine on the c-lightning node.

What information should i be looking for in the logs to trace down this problem?

opened and lnd ticket too cause i'm not quite sure... :)

https://github.com/lightningnetwork/lnd/issues/1982

The logs really don't show enough information to see what happened, could you pipe the output somewhere, or specify --log-file=logfile in order to collect all logs, just in case this happens again.

Apologies but how should i run the command to get the in depth logs? I'm learning a lot of this as i go.

bitcoin-lightning-cli.sh getlog?????

It's still not connecting to the lnd node, the command does nothing at all even though i'm able to make payments to my c-lightning node via routes from my lnd.

Thank you so much for taking the time to assist!

No problem. You can redirect the logs to a logfile by starting the daemon like this:

lightningd/lightningd --network=bitcoin --log-level=debug ...other options... |& tee logfile.txt

And then you have the file logfile.txt that will contain all the output. That'll help a lot (and won't get pruned away like the in-memory logs that getlog serves).

I updated to the newest version of c-lightning and lnd. all the issues i was having have now gone away.

Was this page helpful?
0 / 5 - 0 ratings