synonymdev / react-native-ldk

React Native LDK
MIT License
51 stars 16 forks source link

bug: LDK crashing on channel point lookup #147

Open bennyhodl opened 1 year ago

bennyhodl commented 1 year ago

I am having an issue with LDK setting transaction as confirmed. I can create the channel but when the channel is ready to be confirmed it crashes.

Context

I am using mempool.space api & js library and connected to MutinyNet Channel open transaction: https://mutinynet.com/tx/ea5d159a3b2fa1a0d52023d3ebe8dfc3d5539c00a685eed313e199b85bb106d2

Logs:

Transaction from mempool
{
  "txid": "ea5d159a3b2fa1a0d52023d3ebe8dfc3d5539c00a685eed313e199b85bb106d2",
  "version": 2,
  "locktime": 0,
  "vin": [
    {
      "txid": "8aad156439cf16dd790bb9da56e10ecafc9b45b62244b2bbe7e004294ab16f0b",
      "vout": 1,
      "prevout": {
        "scriptpubkey": "51206c59fbef4da4b7cbc8388ea4ad42ad638ecd8467046c534ea403699092ed5c4c",
        "scriptpubkey_asm": "OP_PUSHNUM_1 OP_PUSHBYTES_32 6c59fbef4da4b7cbc8388ea4ad42ad638ecd8467046c534ea403699092ed5c4c",
        "scriptpubkey_type": "v1_p2tr",
        "scriptpubkey_address": "tb1pd3vlhm6d5jmuhjpc36j26s4dvw8vmpr8q3k9xn4yqd5epyhdt3xqxxpnz0",
        "value": 899527
      },
      "scriptsig": "",
      "scriptsig_asm": "",
      "witness": [
        "d3a179e619c396e7e294877435458b12553812a3b6f233affe0ea3667035d67982912574aba58a2dc6a5a0399f7e67e477f112909e963701fb08e8fb7a61ea91"
      ],
      "is_coinbase": false,
      "sequence": 0
    }
  ],
  "vout": [
    {
      "scriptpubkey": "00201b455e22733aac02829f5bd52699d9e335e2b727a35458d04d35921daa58fd94",
      "scriptpubkey_asm": "OP_0 OP_PUSHBYTES_32 1b455e22733aac02829f5bd52699d9e335e2b727a35458d04d35921daa58fd94",
      "scriptpubkey_type": "v0_p2wsh",
      "scriptpubkey_address": "tb1qrdz4ugnn82kq9q5lt02jdxweuv679de85d2935zdxkfpm2jclk2q035m67",
      "value": 100000
    },
    {
      "scriptpubkey": "5120f28587d2c578933412c4cc3040e717bb7e2fa91af941fc4f90bbc2bac4c7a671",
      "scriptpubkey_asm": "OP_PUSHNUM_1 OP_PUSHBYTES_32 f28587d2c578933412c4cc3040e717bb7e2fa91af941fc4f90bbc2bac4c7a671",
      "scriptpubkey_type": "v1_p2tr",
      "scriptpubkey_address": "tb1p72zc05k90zfngykyescypechhdlzl2g6l9qlcnush0pt43x85ecsw5d6az",
      "value": 799372
    }
  ],
  "size": 205,
  "weight": 616,
  "fee": 155,
  "status": {
    "confirmed": true,
    "block_height": 249819,
    "block_hash": "000001c09b546020517e2e4b293e367687c2bff5b8c1f70dda959898fcc30ae9",
    "block_time": 1689695639
  }
}
getTransactionData result

{
  "header": "000000204f74f35ee0637225eecd8626c77c12268d6386229689fc09ca1aeecc11000000234984345f18121dd9dc3f1af7ff31fead04cc0d9619d9f39aff74b372cc0eab97b5b664ae77031ea3331500",
  "height": 249819,
  "transaction": "ea5d159a3b2fa1a0d52023d3ebe8dfc3d5539c00a685eed313e199b85bb106d2",
  "vout": [
    {
      "hex": "00201b455e22733aac02829f5bd52699d9e335e2b727a35458d04d35921daa58fd94",
      "n": 0,
      "value": 100000
    },
    {
      "hex": "5120f28587d2c578933412c4cc3040e717bb7e2fa91af941fc4f90bbc2bac4c7a671",
      "n": 1,
      "value": 799372
    }
  ]
}
getTransactionPos

1

It fails after printing the transaction position so the failure i believe is coming from https://github.com/synonymdev/react-native-ldk/blob/master/lib/src/lightning-manager.ts#L541

Link to source is here: https://github.com/bennyhodl/baywallet/blob/63-crashing-on-reading-channel-point-on-chain/src/backend/mempool.ts

Jasonvdb commented 1 year ago

Know if this is still an issue with LDK 116?

JeanlChristophe commented 8 months ago

@bennyhodl this issue should be fixe now. Can you confirm in order to close the ticket?