claimRevokedHtlcTxOutputs

fun claimRevokedHtlcTxOutputs(keyManager: KeyManager, commitments: Commitments, revokedCommitPublished: RevokedCommitPublished, htlcTx: Transaction, feerates: OnChainFeerates): Pair<RevokedCommitPublished, List<Transactions.TransactionWithInputInfo.ClaimHtlcDelayedOutputPenaltyTx>>

Claims the output of an [HtlcSuccessTx] or [HtlcTimeoutTx] transaction using a revocation key.

In case a revoked commitment with pending HTLCs is published, there are two ways the HTLC outputs can be taken as punishment:

  • by spending the corresponding output of the commitment tx, using [ClaimHtlcDelayedOutputPenaltyTx] that we generate as soon as we detect that a revoked commit has been spent; note that those transactions will compete with [HtlcSuccessTx] and [HtlcTimeoutTx] published by the counterparty.

  • by spending the delayed output of [HtlcSuccessTx] and [HtlcTimeoutTx] if those get confirmed; because the output of these txs is protected by an OP_CSV delay, we will have time to spend them with a revocation key. In that case, we generate the spending transactions "on demand", this is the purpose of this method.

NB: when anchor outputs is used, htlc transactions can be aggregated in a single transaction if they share the same lockTime (thanks to the use of sighash_single | sighash_anyonecanpay), so we may need to claim multiple outputs.