Map a local Lightning channel to its Bitcoin funding output
An onchain investigation needs the exact funding outpoint. One transaction can open multiple channels, so the transaction hash on its own may be ambiguous.
Select the peer's funding records
Set PEER to the public key at the other end. Read the channels array from the local node's listfunds response. Several rows for the same peer are possible.
lightning-cli listfunds | jq --arg p "$PEER" '.channels[] | select(.peer_id == $p) | {funding_txid, funding_output, amount_msat, our_amount_msat}'
Reconcile the onchain record
Use the pair funding_txid and funding_output to locate the Bitcoin output. Divide amount_msat by 1,000 for its channel value in satoshis. our_amount_msat describes your side of the channel and can change as payments move, so it is unsuitable as a fixed funding-amount check.