From f464aa97c3c534666991c6cb3496058bc0d0de4e Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Thu, 28 Sep 2023 12:31:43 -0700 Subject: [PATCH] Expose witness_script for StaticPaymentOutputDescriptor --- lightning/src/sign/mod.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lightning/src/sign/mod.rs b/lightning/src/sign/mod.rs index 9a3025304..39f1001c4 100644 --- a/lightning/src/sign/mod.rs +++ b/lightning/src/sign/mod.rs @@ -134,6 +134,22 @@ pub struct StaticPaymentOutputDescriptor { pub channel_transaction_parameters: Option, } impl StaticPaymentOutputDescriptor { + /// Returns the `witness_script` of the spendable output. + /// + /// Note that this will only return `Some` for [`StaticPaymentOutputDescriptor`]s that + /// originated from an anchor outputs channel, as they take the form of a P2WSH script. + pub fn witness_script(&self) -> Option