File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -828,6 +828,9 @@ async fn test_cli_list_channels() {
828828 // configured, so the reserve type is deterministically Adaptive.
829829 assert_eq ! ( channel[ "reserve_type" ] . as_i64( ) , Some ( ReserveType :: Adaptive as i64 ) ) ;
830830 assert ! ( !channel[ "channel_type" ] . as_object( ) . unwrap( ) . is_empty( ) ) ;
831+
832+ // A funded, usable channel has a real funding redeem script.
833+ assert ! ( channel[ "funding_redeem_script" ] . as_str( ) . is_some_and( |s| !s. is_empty( ) ) ) ;
831834}
832835
833836#[ tokio:: test]
Original file line number Diff line number Diff line change @@ -568,6 +568,13 @@ message Channel {
568568 // The negotiated channel-type features, keyed by the signaled BOLT feature bit.
569569 // This map is empty until channel negotiation determines the channel type.
570570 map <uint32 , Feature > channel_type = 33 ;
571+
572+ // The hex-encoded witness script that locks the channel's funding output to commitment
573+ // transactions.
574+ //
575+ // Will be unset if we have not negotiated the funding transaction with our counterparty
576+ // already.
577+ optional string funding_redeem_script = 34 ;
571578}
572579
573580// ChannelConfig represents the configuration settings for a channel in a Lightning Network node.
Original file line number Diff line number Diff line change @@ -679,6 +679,13 @@ pub struct Channel {
679679 /// This map is empty until channel negotiation determines the channel type.
680680 #[ prost( btree_map = "uint32, message" , tag = "33" ) ]
681681 pub channel_type : :: prost:: alloc:: collections:: BTreeMap < u32 , Feature > ,
682+ /// The hex-encoded witness script that locks the channel's funding output to commitment
683+ /// transactions.
684+ ///
685+ /// Will be unset if we have not negotiated the funding transaction with our counterparty
686+ /// already.
687+ #[ prost( string, optional, tag = "34" ) ]
688+ pub funding_redeem_script : :: core:: option:: Option < :: prost:: alloc:: string:: String > ,
682689}
683690/// ChannelConfig represents the configuration settings for a channel in a Lightning Network node.
684691/// See more: <https://docs.rs/lightning/latest/lightning/util/config/struct.ChannelConfig.html>
Original file line number Diff line number Diff line change @@ -145,6 +145,7 @@ pub(crate) fn channel_to_proto(channel: ChannelDetails) -> Channel {
145145 . map ( |s| channel_shutdown_state_to_proto ( s) as i32 ) ,
146146 reserve_type : channel. reserve_type . as_ref ( ) . map ( |r| reserve_type_to_proto ( r) as i32 ) ,
147147 channel_type,
148+ funding_redeem_script : channel. funding_redeem_script . map ( |script| script. to_hex_string ( ) ) ,
148149 }
149150}
150151
You can’t perform that action at this time.
0 commit comments