lightning icon indicating copy to clipboard operation
lightning copied to clipboard

[bug] UTXO Created for Channel Open, but Channel Never Opened...

Open kn0wmad opened this issue 1 year ago • 3 comments

... and the node seems to have no knowledge of the UTXO or its address, which appear in public mempools. Now the funds seem to be in some sort of purgatory.

Issue and Steps to Reproduce

I'm not sure how to repro this. The original channel open was done in a high-fee environment, which could perhaps have added to the problem.

It seems that a tx was made on the blockchain that includes the correct amount for the channel open, but instead of ever opening the channel (peer also does not see it), it just goes to an address that the node is seemingly unaware of. The state of the "channel" was 'stuck' in CHANNELD_AWAITING_LOCKIN until a force close was sent. It is now in AWAITING_UNILATERAL status. The node does not list the address or onchain utxo.

I will send specifics of these via DM @cdecker

getinfo output

{
   "id": "redacted",
   "alias": "redacted",
   "color": "f2e64f",
   "num_peers": 2,
   "num_pending_channels": 0,
   "num_active_channels": 0,
   "num_inactive_channels": 1,
   "address": [
      {
         "type": "torv3",
         "address": "redacted.onion",
         "port": 9735
      }
   ],
   "binding": [
      {
         "type": "ipv4",
         "address": "0.0.0.0",
         "port": 9735
      }
   ],
   "version": "v23.11.2-modded",
   "blockheight": 829419,
   "network": "bitcoin",
   "fees_collected_msat": 0,
   "lightning-dir": "/root/.lightning/bitcoin",
   "our_features": {
      "init": "08a0800a0a69a2",
      "node": "88a0800a0a69a2",
      "channel": "",
      "invoice": "02000002024100"
   }

kn0wmad avatar Feb 07 '24 21:02 kn0wmad

After looking into the specifics of this case I think what happened is the following:

  • @kn0wmad funded two channels:
    • A confirmed ok, and then was closed. This is the funding TXID that was shared with me
    • B never confirmed, and after 2 weeks of waiting the peer shared a close transaction, and then forgot about it
  • It appears that we had a mixup, looking at the on-chain footprint of A while trying to debug B
  • Looking into listtransactions we found both the funding transaction, as well as the canned close transaction, that is to be used if the funding eventually confirms but the peer has forgotten about it.

Closing as it appears to work as expected.

If you would like to clean up your listpeerchannels output, see the FAQ > How to forget about a channel

cdecker avatar Feb 20 '24 12:02 cdecker

Forgot channel and did a dev-rescan, but the address and utxo still do not appear in the onchain wallet. Attempting a 10k block rescan now. Will report back, but this may need to be re-opened.

kn0wmad avatar Feb 23 '24 16:02 kn0wmad

Block rescan did not result in return of funds to onchain wallet. Please re-open. CC @cdecker

kn0wmad avatar Feb 26 '24 15:02 kn0wmad