You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Track ChannelTransactionParameters in RevokedHTLCOutput
The `ChannelMonitor` and `OnchainTxHandler` have historically been tied
together, often tracking some of the same state twice. As we introduce
support for splices in the `ChannelMonitor`, we'd like to avoid leaking
some of those details to the `OnchainTxHandler`. Ultimately, the
`OnchainTxHandler` should stand on its own and support claiming funds
from multiple `ChannelMonitor`s, allowing us to save on fees by batching
aggregatable claims across multiple in-flight closing channels.
This commit tracks the `ChannelTransactionParameters` for the specific
`FundingScope` the `RevokedHTLCOutput` claim originated from. Once
splices are supported, we may run into cases where we are attempting to
claim an output from a specific `FundingScope`, while also having an
additional pending `FundingScope` for a splice. If the pending splice
confirms over the output claim, we need to cancel the claim and re-offer
it with the set of relevant parameters in the new `FundingScope`.
let witness_script = chan_utils::get_htlc_redeemscript_with_explicit_keys(&outp.htlc,&onchain_handler.channel_type_features(),&chan_keys.broadcaster_htlc_key,&chan_keys.countersignatory_htlc_key,&chan_keys.revocation_key);
852
+
let witness_script = chan_utils::get_htlc_redeemscript_with_explicit_keys(
ifletOk(sig) = onchain_handler.signer.sign_justice_revoked_htlc(channel_parameters,&bumped_tx, i, outp.amount,&outp.per_commitment_key,&outp.htlc,&onchain_handler.secp_ctx){
841
859
letmut ser_sig = sig.serialize_der().to_vec();
@@ -1670,7 +1688,12 @@ mod tests {
1670
1688
let dumb_point = PublicKey::from_secret_key(&secp_ctx,&dumb_scalar);
1671
1689
let hash = PaymentHash([1;32]);
1672
1690
let htlc = HTLCOutputInCommitment{ offered:false, amount_msat:1_000_000, cltv_expiry:0, payment_hash: hash, transaction_output_index:None};
0 commit comments