From 6b738c6dac0fb565f5ecf4f052629b655acb123c Mon Sep 17 00:00:00 2001 From: Alec Chen Date: Tue, 8 Oct 2024 16:42:02 -0700 Subject: [PATCH] Add witness script for non-anchor static payment output psbt --- lightning/src/sign/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lightning/src/sign/mod.rs b/lightning/src/sign/mod.rs index 8ad34f2d653..328f3cea86a 100644 --- a/lightning/src/sign/mod.rs +++ b/lightning/src/sign/mod.rs @@ -177,11 +177,14 @@ impl StaticPaymentOutputDescriptor { /// originated from an anchor outputs channel, as they take the form of a P2WSH script. pub fn witness_script(&self) -> Option { self.channel_transaction_parameters.as_ref().and_then(|channel_params| { + let payment_point = channel_params.holder_pubkeys.payment_point; if channel_params.supports_anchors() { - let payment_point = channel_params.holder_pubkeys.payment_point; Some(chan_utils::get_to_countersignatory_with_anchors_redeemscript(&payment_point)) } else { - None + Some(ScriptBuf::new_p2pkh( + &bitcoin::PublicKey::new(payment_point) + .pubkey_hash(), + )) } }) }