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.
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`.
This commit tracks the `ChannelTransactionParameters` for the specific
`FundingScope` the `RevokedHTLCOutput` claim originated from. This
allows us to remove the dependency on `OnchainTxHandler` when obtaining
the current `ChannelTransactionParameters` and ensures any alternative
state due to splicing does not leak into the `OnchainTxHandler`.
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);
820
+
let witness_script = chan_utils::get_htlc_redeemscript(
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){
809
825
letmut ser_sig = sig.serialize_der().to_vec();
@@ -1624,7 +1640,12 @@ mod tests {
1624
1640
let dumb_point = PublicKey::from_secret_key(&secp_ctx,&dumb_scalar);
1625
1641
let hash = PaymentHash([1;32]);
1626
1642
let htlc = HTLCOutputInCommitment{ offered:false, amount_msat:1_000_000, cltv_expiry:0, payment_hash: hash, transaction_output_index:None};
0 commit comments