UTXO missing from wallet after a restart and an unwanted local force-close
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- c
- 领域
- backend, blockchain
调研方向
首先通过 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:
- anchor
- anchor
- the missing unspent UTXO (215289 sats)
- remaining funds of their side (1860779 sats)
- 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--rescanwith a large value (before the funding transaction)
- 主要语言
- C
- 星标
- 3.1k
- 派生
- 1k
- 平均合并
- 3 天 17 小时
- 30 天内合并 PR
- 27
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ElementsProject/lightning 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
ElementsProject/lightning#9634 ·
维护者通常 1 天内回复
-
plugins/recover: missing comma in nodes_for_gossip concatenates two bootstrap addresses into invalid address可能已有人在做 @bhuvan-somisetty 于 11 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
ElementsProject/lightning#9630 ·
维护者通常 1 天内回复
-
common/json_parse: json_to_bitcoin_amount fails to detect overflow and accepts negative/empty inputs可能已有人在做 @bhuvan-somisetty 于 16 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
ElementsProject/lightning#9617 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
ElementsProject/lightning#9616 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 90/100
ElementsProject/lightning#9593 ·
维护者通常 1 天内回复
查看 ElementsProject/lightning 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
yunusemreyl/omen-space#337 ·
维护者通常 1 天内回复
-
dependency component: oneMKL module: dpclang
难度 2/5 1-3 小时 新手友好度 82/100
intel/torch-xpu-ops#5880 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
netty/netty-tcnative#1024 ·