Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

UTXO missing from wallet after a restart and an unwanted local force-close

未关闭
#9,200 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
c

调研方向

首先通过 onchaind 日志跟踪重启路径,尤其是“Unknown commitment”之后的恢复过程以及向 ONCHAIN 的转换。将关闭交易的五个输出与 listfunds、listclosedchannels 和 bkpr-listaccountevents 进行比较,然后使用 dev-rescan-outputs 或 --rescan 验证缺失的 UTXO 是否已恢复,并且不再被分类为 onchain_fee。

由索引模型根据 Issue 内容生成。

描述

After a restart of the node, it automatically force-closed a channel but an UTXO in the closing transaction (resulting from a pending HTLC) is missing in the output of listfunds.

CLN version: v25.12.1
Bitcoind version: 31.0
funding transaction: 7e907aa45a014c1666a5d1eefe98d4245b616abd02b9398d42293bc23aca2cce
closing transaction: 5bf58ab7e136d74d837472eaa907a5b3c508e4dfd8a20063c4814ebdddc1de4b

The closing transaction results in 5 outputs:

  1. anchor
  2. anchor
  3. the missing unspent UTXO (215289 sats)
  4. remaining funds of their side (1860779 sats)
  5. remaining funds of our side (9922922 sats)

listclosedchannels shows we should own this UTXO:

"final_to_us_msat": 10138211724

bkpr-listaccountevents shows this output as onchain_fee :

{
   "account": "ce2cca3ac23b29428d39b902bd6a615b24d498feeed1a566164c015aa47a907f",
   "type": "onchain_fee",
   "tag": "onchain_fee",
   "credit_msat": 215289724,
   "debit_msat": 0,
   "currency": "bc",
   "timestamp": 1780321071,
   "txid": "5bf58ab7e136d74d837472eaa907a5b3c508e4dfd8a20063c4814ebdddc1de4b"
}

The logs of this channel just after I restarted CLN:

2026-06-01T12:30:39.470Z UNUSUAL 03a93b87bf9f052b8e862d51ebbac4ce5e97b5f4137563cd5128548d7f5978dda9-chan#11240: Peer permanent failure in CHANNELD_NORMAL: channeld: sent Awaiting unilateral close (reason=local)
2026-06-01T12:30:39.470Z INFO    03a93b87bf9f052b8e862d51ebbac4ce5e97b5f4137563cd5128548d7f5978dda9-chan#11240: State changed from CHANNELD_NORMAL to AWAITING_UNILATERAL
2026-06-01T12:30:39.472Z **BROKEN** 03a93b87bf9f052b8e862d51ebbac4ce5e97b5f4137563cd5128548d7f5978dda9-chan#11240: Cannot broadcast our commitment tx: they have a future one
2026-06-01T13:37:51.100Z UNUSUAL 03a93b87bf9f052b8e862d51ebbac4ce5e97b5f4137563cd5128548d7f5978dda9-chan#11240: Peer permanent failure in AWAITING_UNILATERAL: Funding transaction spent: onchain txid 5bf58ab7e136d74d837472eaa907a5b3c508e4dfd8a20063c4814ebdddc1de4b (reason=unknown)
2026-06-01T13:37:51.100Z **BROKEN** 03a93b87bf9f052b8e862d51ebbac4ce5e97b5f4137563cd5128548d7f5978dda9-chan#11240: Cannot broadcast our commitment tx: they have a future one
2026-06-01T13:37:51.100Z INFO    03a93b87bf9f052b8e862d51ebbac4ce5e97b5f4137563cd5128548d7f5978dda9-chan#11240: State changed from AWAITING_UNILATERAL to FUNDING_SPEND_SEEN
2026-06-01T13:37:51.129Z **BROKEN** 03a93b87bf9f052b8e862d51ebbac4ce5e97b5f4137563cd5128548d7f5978dda9-onchaind-chan#11240: ERROR: Unknown commitment #1457929, recovering our funds!
2026-06-01T13:37:51.129Z INFO    03a93b87bf9f052b8e862d51ebbac4ce5e97b5f4137563cd5128548d7f5978dda9-chan#11240: State changed from FUNDING_SPEND_SEEN to ONCHAIN
2026-06-02T07:38:44.777Z INFO    03a93b87bf9f052b8e862d51ebbac4ce5e97b5f4137563cd5128548d7f5978dda9-chan#11240: onchaind complete, forgetting peer

What I've tried:

  • dev-rescan-outputs
  • --rescan with a large value (before the funding transaction)
主要语言
C
星标
3.1k
派生
1k
平均合并
3 天 17 小时
30 天内合并 PR
27

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ElementsProject/lightning 的其他 Issue

查看 ElementsProject/lightning 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。