Skip to content

onchaind crash: “Could not find resolution for output 2” on anchors + lost_state channel #8880

@tikistack-sudo

Description

@tikistack-sudo

Summary

Core Lightning v25.12.1 onchaind crashes for an anchors + static_remotekey channel with:

STATUS_FAIL_INTERNAL_ERROR: Could not find resolution for output 2

even though that output belongs to the remote and is already spent.

Environment

  • Core Lightning version: v25.12.1
  • Build: [package or self-built from source, include git commit if you have it]
  • Network: bitcoin mainnet
  • Backend: bitcoind (no txindex, pruned? yes/no)
  • Host: Raspberry Pi (64‑bit, OS: [your distro/version])

Channel details

  • Peer id: 03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f
  • short_channel_id: 928319x1161x0
  • funding_txid: 004dee0b164d82f5ecf716a70f659e206644f46ae0a3bfc5f4aeeaf1d32dbc4d, vout: 0
  • channel_type.names: ["static_remotekey/even","anchors/even"]
  • lost_state: true
  • state: ONCHAIN
  • status: ["ONCHAIN:Owning subdaemon onchaind died (61952)"]

Relevant listpeerchannels snippet:

{
  "channels": [
    {
      "peer_id": "03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f",
      "channel_type": {
        "bits":,[2][3]
        "names": ["static_remotekey/even", "anchors/even"]
      },
      "state": "ONCHAIN",
      "lost_state": true,
      "scratch_txid": "84bbfec75a53ab60785d66c4f9a7f096793c610fb0c93ac5bdfbf5c5bb95eb33",
      "short_channel_id": "928319x1161x0",
      "channel_id": "4dbc2dd3f1eaaef4c5bfa3e06af44466209e650fa716f7ecf5824d160bee4d00",
      "funding_txid": "004dee0b164d82f5ecf716a70f659e206644f46ae0a3bfc5f4aeeaf1d32dbc4d",
      "funding_outnum": 0,
      "close_to_addr": "bc1pt27ne5sn5zkfzfj7ls0rs2dhqwxmudksur6a8l5pt4k0yjrut7ys35swky",
      "opener": "local",
      "closer": "local",
      "features": ["option_static_remotekey", "option_anchors"],
      "status": [
        "ONCHAIN:Owning subdaemon onchaind died (61952)"
      ]
    }
  ]
}

Logs around the crash

... INFO lightningd: Server started with public key 02577b9cde9daca28d01c27b323dfa38ddc1114258b7091aba45f9c00eb61678e0 ...

lightning_onchaind: Could not find resolution for output 2 (version v25.12.1)
...
**BROKEN** 03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f-onchaind-chan#1:
STATUS_FAIL_INTERNAL_ERROR: Could not find resolution for output 2
**BROKEN** 03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f-chan#1:
Owning subdaemon onchaind died (61952)


Commitment transaction

This is the on-chain tx spending the funding outpoint:

    txid: d9be1412596fab9b9c0417010393c2493f208220dac0efb2bb5f76be020d6db3

    blockheight: 934855



Output 2 (index 2) has since been spent on-chain.

The spending transaction is not recognized by my Bitcoin Core wallet, so output 2 appears to be remote‑owned.

Output 4 (belonging to me) have not shown up in CLN listfunds



Channel transitions through CHANNELD_NORMAL → AWAITING_UNILATERAL → FUNDING_SPEND_SEEN → ONCHAIN.

onchaind logs “Could not find resolution for output 2”, then:

    STATUS_FAIL_INTERNAL_ERROR: Could not find resolution for output 2

    Marks the channel as **BROKEN** and exits, leading to status ONCHAIN:Owning subdaemon onchaind died (61952).

lost_state is true on this channel.

Questions

    Is onchaind expected to handle anchors + lost_state channels without aborting when there is a remote‑only output like this?

    Is there a known fix or patch for this scenario in a newer CLN release?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions