Lightning: "Cannot afford transaction" even though enough balance and txid confirmed but c-lightning thinks it's not

Created on 28 Nov 2019  路  8Comments  路  Source: ElementsProject/lightning

Issue and Steps to Reproduce

Even though I have 1,181,431. I can't withdraw with withdraw all. It seems that bitcoind can't communicate that some tx are atually confirmed, but I'm not quite sure.

Environment

  • BTCPay Server
  • version": "basedon-v0.7.3
  • Docker deployment
  • Pruned node

getinfo output

```{
"id": "02d35ad6428b083d63575e3b0ce33e06c507910c131970b07dc194953b43a9794c",
"alias": "BitcoinShirt",
"color": "02d35a",
"num_peers": 14,
"num_pending_channels": 0,
"num_active_channels": 2,
"num_inactive_channels": 3,
"address": [
{
"type": "ipv4",
"address": "172.81.181.159",
"port": 9735
},
{
"type": "torv3",
"address": "fj2b35ny3kaxessk6su3ydbeh3ppqmxykqzbshesf43kzwgmmrjp2sid.onion",
"port": 9735
}
],
"binding": [
{
"type": "ipv4",
"address": "0.0.0.0",
"port": 9735
}
],
"version": "basedon-v0.7.3",
"blockheight": 605782,
"network": "bitcoin",
"msatoshi_fees_collected": 93397,
"fees_collected_msat": "93397msat"
}

### dev-rescan-outputs

{
"outputs": [
{
"txid": "a045f4a18c069da453122f1463afb737252f9ebeb61c54feeb1075babfe96050",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "223089e75c97e7fe19561a39c39a6937cb7a34733552bc44ba9ceafa2ad5b213",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "5761eff592c57afa9da4bfaef5cbe8324c71251e4b4c21e1d098497f3b704d3e",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "fad6d3cdbab7d13b83f5fef23a34e0d079663e275af77c5c4cc218392430f0ab",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "549b626be823847a3bb655e5d3a13bac4b234a212f3717fd9c1eae26ad13c78b",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "527c67f965c0761cb924b0935720807ad27c77fcd6e6ea3a426e735f43b1852f",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "0d44f704ae7dccfa1f2edcf220d1ce2451418af77e4b489d4ae9e33ebf16b901",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "df84b186eabfb5907e380a289661976a061b31703b4504d13bf021972d697ba2",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "3ecaf545843a4ffbc88b3fc9d39b17f8cf791aa794031c70c615de9f11947dc8",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "423c7ebfc188078c62991398830542543f7428bb8a0e46b232d841f68d9be960",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "6909a6ac981f3957ba7ea76e61fc37c40ec9fbfb84f5d92cb38fd3bbd4816066",
"output": 1,
"oldstate": 0,
"newstate": 0
},
{
"txid": "dd3cc53a38c5925c0cbf4f9ea21ae9f80661f0048f0392dfecdc4f71639be6bb",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "424477f3e9278e61b14fc134852241fe7c89fa2e73679e448a7643f1be138787",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "36fd0517661c80f3d607908838060cf0edc2090c4c8f85ad7f5ba930dfcb15e1",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "bd0c0381d6829d88d429cc9dd1602c21b48d6076032f451819a0cfb54a89dabc",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "4b9ec66d4b93ebb2bab660932860d6d127bb9f3a69d1460081d1077a5c44c1e1",
"output": 1,
"oldstate": 0,
"newstate": 0
},
{
"txid": "75b09956a19418e419e4e388677a13e24016aa1e549f1ec4d923b1bb9422d9a4",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "24f96e025e4eb2d22681890bb697971f3bfbeb214b0a69fc0a838a4cd0a3afa5",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "0ef2ec04a7c7382591877178a1d1288817e5d0ef701188c3368e0b907880d8b3",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "3f048ac82538a7d75830c186a36dd61831e75b3b0092c9a2a0d259bd26baaddd",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "7629f9e27630488489b002aa6d8d9e2a5f806c27299d5dcd063f052fc85faad0",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "7d097b9c2da241fd56c83354bb946a1a1d3563bceb82fa5ac65b33adcc87efa0",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "71060f9c6549910baa478b2f973cea43781ffa3491bf5a370d1e25f066be4a5f",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "6759140d684a7f0133b6e7ba450aa9396061356ddab8cc907c2b43e990a28f04",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "c1d77a8aa891ab88861677423ebeb69d28efca7a4345befdcbd99a4368f6b774",
"output": 1,
"oldstate": 0,
"newstate": 0
},
{
"txid": "fc9be8a869f4e63461bc87ef3fbd20f9d5c05a293d807970730037170610e941",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "2c30e3719925c4ae0614684af914cc5a0b6afcc06a685007fbbb653b3cd6ce0d",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "9bb26082fe02899f09d6c4050428a93f7a4459f8f577f30e26c3a9880a854896",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "d4f727dcb45982164f60d08e366414e4d62444d72399f2ada8c807171c86079d",
"output": 0,
"oldstate": 0,
"newstate": 0
},
{
"txid": "72f1aec50c294bf05ed8549a7c166816489612add51dd8a863b4e541b96ab6c4",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "9e836459b72cb715d70830652680b3201e6ab872196526236ec93d95214b0ae2",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "e8a36f42164f07f0c6e81c3fff916b77369e34e083af37dfdd50e6895d82f1cc",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "51f204bf9efd140a7589cb4c4bcb396ea76d71c8be94cb1820d82c55bcfcafcc",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "9f20c5a60b7e4f038456f7e597de58e643f8a23664ab93504cbc0f392aaf5897",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "03ecc87ecbb1cdbaaea4fac2e079cde2e2caf24557102eb5218926018e2db967",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "2119d1fc37ae99f1b368712b5f5c4b25387ffe23c0701763b3b83a6e7219ea53",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "5a5b1e905246e4bcc4c564a32081ac6d59c87db0c9439af11c0bafb8719dc74b",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "2b6b818fbf00daaee4fdc3e0f9455f43c0ec6a685972fc3689d9f0a4f8ed1a28",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "4cca5f31002de30db663c8ef2e2a40db9898159bcb58b79761da091e2f7f1e27",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "f376d980e62d0039b686e8d0d4ff77eed5f30443e1da5b9406b4cd8b7ca638ca",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "b744539add49d8a25e06830ceedbcae8784918a0dfb8a2eff6c95b1e8b08afcd",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "bc707ae491659b44b376fffa53fe3f4e565bf0b0b91c399707d6016d0a417e57",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "9f2c4b20b34996787d9db86244f4da57f113d3db67efa5ddaeb1dde202fe7d6a",
"output": 1,
"oldstate": 2,
"newstate": 2
},
{
"txid": "ee56558962279024c0d29178e0fb18501ba3cffe20229001f9cfa781a3879218",
"output": 1,
"oldstate": 2,
"newstate": 2
},
{
"txid": "298c2c2ae8249873303dbe581bbf8410fc7ba6868824f89d2cdb3550d79de4c9",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "cdc916adaabbe85c4e317486fe5d21c146731dd2b53d223656e9e00e4efd6408",
"output": 1,
"oldstate": 2,
"newstate": 2
},
{
"txid": "681d8fdc96c824b9cf0840271bac2d38a5d30be77ef757535235cf81ea87e918",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "231ce70427ae32460fd9d2aae723c2fb4db7ce4db03a6585375ddd6e99ec7260",
"output": 1,
"oldstate": 2,
"newstate": 2
},
{
"txid": "00fbfe13906d108e77789a768f1363c7415f2a19025235b4a86a63d9fab62dca",
"output": 1,
"oldstate": 2,
"newstate": 2
},
{
"txid": "6b0f7a8a886ed259696a9013a3e6455a85c99119811b082a72d15cb84da1bbbd",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "b18f144e7459f895bbb54bebc73b57212eac700b68766bb341af40c2dae58d46",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "f23c5b13d18cec61a8318deaf0c385f1bd3e896c702639a3393e6c4cd5cfdac1",
"output": 1,
"oldstate": 2,
"newstate": 2
},
{
"txid": "0e2b73b935e8a9a4caa897b69a147497fd353c312dd0c79598dce05b9876a161",
"output": 1,
"oldstate": 2,
"newstate": 2
},
{
"txid": "e1d88ed0e285086423af28e36f1b7f86644f58275707790b55f5c1a2cd661c8c",
"output": 1,
"oldstate": 2,
"newstate": 2
},
{
"txid": "c37e50680b01bf49790ef139d78867cce70663ba93016b0543f548277ed8161b",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "76ea3fd3ddac51351895bfb4dbffed09eeef80d5d25f70659aec1c725724c95e",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "2d59a17f7d2970cfdca529dd5a99fe03867461cbf1e5e54e2aa134293d485caa",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "e38fdc37668960c0df3e99004ccb7f3b15e7687cb0ab352ff8322b485ab20a4a",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "ec033f91788efd38bf0c8550423a947662e3a7d16ce4795f9f6219fde838e075",
"output": 0,
"oldstate": 2,
"newstate": 2
},
{
"txid": "c9d0e8798e784b550934091cbd5d23ea7e926219fd37d1e18b848e0daa65a255",
"output": 1,
"oldstate": 2,
"newstate": 2
},
{
"txid": "e787fe31a80a18fb51d681262622a77cedddb2cc66ff97bbae8e7c69e3f59acc",
"output": 0,
"oldstate": 2,
"newstate": 2
}
]
}

### listfunds

{
"outputs": [
{
"txid": "d4f727dcb45982164f60d08e366414e4d62444d72399f2ada8c807171c86079d",
"output": 0,
"value": 148366,
"amount_msat": "148366000msat",
"address": "bc1q7y3skukj3a3afg9x3hhrt9tw8cux6l32gmt97c",
"status": "unconfirmed"
},
{
"txid": "c1d77a8aa891ab88861677423ebeb69d28efca7a4345befdcbd99a4368f6b774",
"output": 1,
"value": 148006,
"amount_msat": "148006000msat",
"address": "bc1qhsrtf5v8c7gemv6507uexus2w66cu8vt3cvejk",
"status": "unconfirmed"
},
{
"txid": "4b9ec66d4b93ebb2bab660932860d6d127bb9f3a69d1460081d1077a5c44c1e1",
"output": 1,
"value": 280307,
"amount_msat": "280307000msat",
"address": "bc1qvs2n5y07fpdamaunu7g7quunru365aj9e9vh90",
"status": "unconfirmed"
},
{
"txid": "6909a6ac981f3957ba7ea76e61fc37c40ec9fbfb84f5d92cb38fd3bbd4816066",
"output": 1,
"value": 604752,
"amount_msat": "604752000msat",
"address": "bc1q6mxjzf6xnzw74s6za2840dk2jjlss7w9yzrwg5",
"status": "unconfirmed"
}
],
"channels": [
{
"peer_id": "03dd80145ece2ff7d69114e2aa4b809c4e93135a869d5833c4b3d1b7b77294c5b8",
"connected": false,
"state": "CHANNELD_SHUTTING_DOWN",
"short_channel_id": "560209x2405x0",
"channel_sat": 0,
"our_amount_msat": "0msat",
"channel_total_sat": 200000,
"amount_msat": "200000000msat",
"funding_txid": "2fcd976e03eb3bd0e2379f39e45acd31aeb274ccb73cd2916985ca57021db642",
"funding_output": 0
},
{
"peer_id": "028963206cd85b526262dcf5435bf9fbd92d606a3dce74c8d7d75e161fbda5a5e3",
"connected": false,
"state": "CHANNELD_SHUTTING_DOWN",
"short_channel_id": "564469x616x0",
"channel_sat": 684142,
"our_amount_msat": "684142000msat",
"channel_total_sat": 977665,
"amount_msat": "977665000msat",
"funding_txid": "c2d452cb8e79ff87a3830765a52544e1be86b81f5cfeba2408ba2985412f5e9d",
"funding_output": 0
},
{
"peer_id": "0260b16d9c3f836d74bf5b50bcb88ddac83c4b98c9ab5b5e5e1236d2fdec8ab4ed",
"connected": false,
"state": "ONCHAIN",
"short_channel_id": "581320x2491x1",
"channel_sat": 0,
"our_amount_msat": "0msat",
"channel_total_sat": 351732,
"amount_msat": "351732000msat",
"funding_txid": "8abe45be952a2ed885c65d5375f56812f1561d21caefd5df2b72be7ec61fd2fc",
"funding_output": 1
},
{
"peer_id": "0283edeebe7f671291077916966b6712afdb9f87dd7fabf68c85ad5290f8d92830",
"connected": false,
"state": "ONCHAIN",
"short_channel_id": "584125x654x0",
"channel_sat": 10106,
"our_amount_msat": "10106000msat",
"channel_total_sat": 190977,
"amount_msat": "190977000msat",
"funding_txid": "a5c6ddce44fc4efc6fb41a5d0c5e9007e5a1552e4daf2d3e34ffd302bd27c938",
"funding_output": 0
},
{
"peer_id": "037bac60fb8b3a3c3f17dc2bcccdce5ecae78ee03bf383f312abc8ffe89c21246f",
"connected": false,
"state": "ONCHAIN",
"short_channel_id": "598035x3369x1",
"channel_sat": 407323,
"our_amount_msat": "407323000msat",
"channel_total_sat": 800000,
"amount_msat": "800000000msat",
"funding_txid": "c4dbe358cf346127afc8438f359d92b754035c0257b9bd5bc457fe96eee98cdc",
"funding_output": 1
}
]
}

### bitcoind
     "log": "bitcoin-cli -datadir=/etc/bitcoin -rpcconnect=bitcoind getblock 0000000000000000001789b01c6ed5f594533b46fe07dc6571fbf961cb1b248d false exited with status 1"

```

Could it be that my by bitcoind is corrupted and can't communicate the feerates to c-lightning as well as show c-lightning that the actual transactions are not unconfirmed

I've looked a bit into #2507 and #2819 but I'm not sure that's my issue, would appreciate some guidance on how to further troubleshoot this and happy to provide any logs.

fixed

Most helpful comment

I think the issue is a left-over from an old version, in which we didn't track
change outputs correctly. The issue has long been addressed, but if channels
were closed back when the issue was unfixed may have these stale entries.

There's two solutions you can try:

  • Rescan the blockchain from before the outputs were confirmed
    (--rescan=-587141 ought to do the trick). This will see the transactions
    appear in a block, setting the confirmation height to the correct
    value. This would allow us to confirm that the underlying issue was
    actually resolved, but could take a while to sync with the blockchain head.
  • Withdraw your entire balance to either an external wallet or a new address
    created with lightning-cli newaddr. In order to side-step the
    coin-selection getting upset because all outputs are thought to be
    unconfirmed you can instead use the following: lightning-cli -k withdraw destination=your-addr-string satoshi=all minconf=0. Notice the
    minconf=0, that tells the coin selection that it may also take
    unconfirmed outputs.

Since you mentioned a pruned node, I think the first option is probably not
really an option, since you can't rescan blocks your bitcoind doesn't
have. But option 2 should work.

All 8 comments

Hi, have you tried dev-rescan-outputs ?

hey @darosior I have, check the outputs there, I put them in the initial issue report.

@pavlenex sorry, I should read more carefully......

Could it be that my by bitcoind is corrupted and can't communicate the feerates to c-lightning as well as show c-lightning that the actual transactions are not unconfirmed

No, it's shown unconfirmed in json output when we don't have the block height for this utxo (which we populate approximatively when there is the Adding block <block number>: <blockhash> log line聽for this block).

"log": "bitcoin-cli -datadir=/etc/bitcoin -rpcconnect=bitcoind getblock 0000000000000000001789b01c6ed5f594533b46fe07dc6571fbf961cb1b248d false exited with status 1"

It looks like your bitcoind isn't aware of this block, though it's in the best chain. So is it a problem on our side, or bitcoind side ? Can you get the block from the CLI ? If not it's probably the latter..

Trashed and re-synced bitcoind, still the same issue I have when I listfunds I still see transactions as unconfirmed even if they are confirmed in reality. According t to my spark wallet in total I have 1,181,431 sat

{
   "outputs": [
      {
         "txid": "d4f727dcb45982164f60d08e366414e4d62444d72399f2ada8c807171c86079d",
         "output": 0,
         "value": 148366,
         "amount_msat": "148366000msat",
         "address": "bc1q7y3skukj3a3afg9x3hhrt9tw8cux6l32gmt97c",
         "status": "unconfirmed"
      },
      {
         "txid": "c1d77a8aa891ab88861677423ebeb69d28efca7a4345befdcbd99a4368f6b774",
         "output": 1,
         "value": 148006,
         "amount_msat": "148006000msat",
         "address": "bc1qhsrtf5v8c7gemv6507uexus2w66cu8vt3cvejk",
         "status": "unconfirmed"
      },
      {
         "txid": "4b9ec66d4b93ebb2bab660932860d6d127bb9f3a69d1460081d1077a5c44c1e1",
         "output": 1,
         "value": 280307,
         "amount_msat": "280307000msat",
         "address": "bc1qvs2n5y07fpdamaunu7g7quunru365aj9e9vh90",
         "status": "unconfirmed"
      },
      {
         "txid": "6909a6ac981f3957ba7ea76e61fc37c40ec9fbfb84f5d92cb38fd3bbd4816066",
         "output": 1,
         "value": 604752,
         "amount_msat": "604752000msat",
         "address": "bc1q6mxjzf6xnzw74s6za2840dk2jjlss7w9yzrwg5",
         "status": "unconfirmed"
      }
   ],
   "channels": [
      {
         "peer_id": "03dd80145ece2ff7d69114e2aa4b809c4e93135a869d5833c4b3d1b7b77294c5b8",
         "connected": false,
         "state": "CHANNELD_SHUTTING_DOWN",
         "short_channel_id": "560209x2405x0",
         "channel_sat": 0,
         "our_amount_msat": "0msat",
         "channel_total_sat": 200000,
         "amount_msat": "200000000msat",
         "funding_txid": "2fcd976e03eb3bd0e2379f39e45acd31aeb274ccb73cd2916985ca57021db642",
         "funding_output": 0
      },
      {
         "peer_id": "028963206cd85b526262dcf5435bf9fbd92d606a3dce74c8d7d75e161fbda5a5e3",
         "connected": false,
         "state": "CHANNELD_SHUTTING_DOWN",
         "short_channel_id": "564469x616x0",
         "channel_sat": 684142,
         "our_amount_msat": "684142000msat",
         "channel_total_sat": 977665,
         "amount_msat": "977665000msat",
         "funding_txid": "c2d452cb8e79ff87a3830765a52544e1be86b81f5cfeba2408ba2985412f5e9d",
         "funding_output": 0
      }
   ]
}

I'm able to get block info, though when I try to fetch some early blocks, I can't because of the pruning.

I'm starting to think this is pruning related issue.

After figuring things out a bit, I can confirm that the issue is that c-lightning simply is not able to figure out that closed channels txid are confirmed, possibly due to the pruned node. dev-rescan-outputs did not help either, at this point I've no idea how to solve this.

outputs:
  - txid: d4f727dcb45982164f60d08e366414e4d62444d72399f2ada8c807171c86079d
    output: 0
    value: 148366
    amount_msat: 148366000msat
    address: bc1q7y3skukj3a3afg9x3hhrt9tw8cux6l32gmt97c
    status: unconfirmed
  - txid: c1d77a8aa891ab88861677423ebeb69d28efca7a4345befdcbd99a4368f6b774
    output: 1
    value: 148006
    amount_msat: 148006000msat
    address: bc1qhsrtf5v8c7gemv6507uexus2w66cu8vt3cvejk
    status: unconfirmed
  - txid: 4b9ec66d4b93ebb2bab660932860d6d127bb9f3a69d1460081d1077a5c44c1e1
    output: 1
    value: 280307
    amount_msat: 280307000msat
    address: bc1qvs2n5y07fpdamaunu7g7quunru365aj9e9vh90
    status: unconfirmed
  - txid: 6909a6ac981f3957ba7ea76e61fc37c40ec9fbfb84f5d92cb38fd3bbd4816066
    output: 1
    value: 604752
    amount_msat: 604752000msat
    address: bc1q6mxjzf6xnzw74s6za2840dk2jjlss7w9yzrwg5
    status: unconfirmed

The only weird thing I see in logs is as mentioned in #3333

  - type: UNUSUAL
    time: '58013.328914653'
    source: 'lightningd(6):'
    log: >-
      bitcoin-cli -datadir=/etc/bitcoin -rpcconnect=bitcoind getblock
      0000000000000000003455ec994236a613587717edd56bb8cec1318fbfb1d887 false
      exited with status 1
  - type: UNUSUAL
    time: '58014.336762627'
    source: 'lightningd(6):'
    log: >-
      bitcoin-cli -datadir=/etc/bitcoin -rpcconnect=bitcoind getblock
      0000000000000000003455ec994236a613587717edd56bb8cec1318fbfb1d887 false
      exited with status 1
  - type: SKIPPED
    num_skipped: 2
bitcoin-cli.sh getblock "0000000000000000003455ec994236a613587717edd56bb8cec1318fbfb1d887"
error code: -1
error message:
Block not available (pruned data)
bitcoin-cli.sh getblock "0000000000000000000eed19b6ad274c6da0dbebffd32fd13d27f5d64cb6036f"
{
  "hash": "0000000000000000000eed19b6ad274c6da0dbebffd32fd13d27f5d64cb6036f",
  "confirmations": 1,
  "strippedsize": 914015,
  "size": 1251186,
  "weight": 3993231,
  "height": 607789,
  "version": 536928256,
  "versionHex": "2000e000",
  "merkleroot": "7167730a88cd493658379ab04bd08c7c6d9420e8ea4636ff404e2d94ac9d7dcd",

Seems the same issue as in #1502

I think the issue is a left-over from an old version, in which we didn't track
change outputs correctly. The issue has long been addressed, but if channels
were closed back when the issue was unfixed may have these stale entries.

There's two solutions you can try:

  • Rescan the blockchain from before the outputs were confirmed
    (--rescan=-587141 ought to do the trick). This will see the transactions
    appear in a block, setting the confirmation height to the correct
    value. This would allow us to confirm that the underlying issue was
    actually resolved, but could take a while to sync with the blockchain head.
  • Withdraw your entire balance to either an external wallet or a new address
    created with lightning-cli newaddr. In order to side-step the
    coin-selection getting upset because all outputs are thought to be
    unconfirmed you can instead use the following: lightning-cli -k withdraw destination=your-addr-string satoshi=all minconf=0. Notice the
    minconf=0, that tells the coin selection that it may also take
    unconfirmed outputs.

Since you mentioned a pruned node, I think the first option is probably not
really an option, since you can't rescan blocks your bitcoind doesn't
have. But option 2 should work.

The second option did the trick, thank you @cdecker!

Thanks @pavlenex for confirming :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

billygarrison picture billygarrison  路  3Comments

softgear picture softgear  路  4Comments

brunoaduarte picture brunoaduarte  路  4Comments

brunoaduarte picture brunoaduarte  路  5Comments

AndiMacTen picture AndiMacTen  路  3Comments