pub fn decode_commitment_tx(
tx: &Transaction,
holder_per_commitment_point: &PublicKey,
cp_per_commitment_point: &Option<PublicKey>,
params: &ChannelTransactionParameters,
secp_ctx: &Secp256k1<All>,
) -> (Option<u32>, Vec<u32>)
Expand description
Decode a commitment transaction and return the outputs that we need to watch. Our main output index and any HTLC output indexes are returned.
cp_per_commitment_point
is filled in if known, otherwise None. It might
not be known if the signer is old, before we started collecting counterparty secrets.
If it is None, then we won’t be able to tell the difference between a counterparty
to-self output and an HTLC output.
The counterparty parameters must be populated.