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
This allows the `to_local` output to easily be changed according to the
features of the channel, or the evolution of the LN specification.
`to_local` could even be set to completely arbitrary scripts if
compatibility with the formal LN spec is not required.
Builders of `CommitmentTransaction` now ask a `ChannelSigner` for the
appropriate `to_local` script pubkey to use, and then pass it to the
`CommitmentTransaction` constructor.
External signers now provide the expected `to_local` script pubkey to
the `verify` call of `CommitmentTransaction`.
let secret = self.get_secret(commitment_number).unwrap();
3508
3513
let per_commitment_key = ignore_error!(SecretKey::from_slice(&secret));
3509
3514
let per_commitment_point = PublicKey::from_secret_key(&self.onchain_tx_handler.secp_ctx,&per_commitment_key);
3510
-
let revocation_pubkey = RevocationKey::from_basepoint(&self.onchain_tx_handler.secp_ctx,&self.holder_revocation_basepoint,&per_commitment_point,);
3511
-
let delayed_key = DelayedPaymentKey::from_basepoint(&self.onchain_tx_handler.secp_ctx,&self.counterparty_commitment_params.counterparty_delayed_payment_base_key,&PublicKey::from_secret_key(&self.onchain_tx_handler.secp_ctx,&per_commitment_key));
3512
-
3513
-
let revokeable_redeemscript = chan_utils::get_revokeable_redeemscript(&revocation_pubkey,self.counterparty_commitment_params.on_counterparty_tx_csv,&delayed_key);
3514
-
let revokeable_p2wsh = revokeable_redeemscript.to_p2wsh();
3515
+
let revokeable_spk = self.onchain_tx_handler.signer.get_revokeable_spk(false, commitment_number,&per_commitment_point,&self.onchain_tx_handler.secp_ctx);
3515
3516
3516
3517
// First, process non-htlc outputs (to_holder & to_counterparty)
3517
3518
for(idx, outp)in tx.output.iter().enumerate(){
3518
-
if outp.script_pubkey == revokeable_p2wsh{
3519
+
if outp.script_pubkey == revokeable_spk{
3519
3520
let revk_outp = RevokedOutput::build(per_commitment_point,self.counterparty_commitment_params.counterparty_delayed_payment_base_key,self.counterparty_commitment_params.counterparty_htlc_base_key, per_commitment_key, outp.value,self.counterparty_commitment_params.on_counterparty_tx_csv,self.onchain_tx_handler.channel_type_features().supports_anchors_zero_fee_htlc_tx());
3520
3521
let justice_package = PackageTemplate::build_package(
// This is the only field of the key cache that we trust
1687
1686
let per_commitment_point = self.keys.per_commitment_point;
1688
1687
let keys = TxCreationKeys::from_channel_static_keys(&per_commitment_point, broadcaster_keys, countersignatory_keys, secp_ctx);
1689
1688
if keys != self.keys{
1690
1689
returnErr(());
1691
1690
}
1692
-
let tx = self.internal_rebuild_transaction(&keys, channel_parameters,&broadcaster_keys.funding_pubkey,&countersignatory_keys.funding_pubkey, to_countersignatory_spk)?;
1691
+
let tx = self.internal_rebuild_transaction(&keys, channel_parameters,&broadcaster_keys.funding_pubkey,&countersignatory_keys.funding_pubkey,to_broadcaster_spk,to_countersignatory_spk)?;
0 commit comments