Skip to content

Commit 55e311d

Browse files
committed
Expose funding_redeem_script on Channel
1 parent 88016a5 commit 55e311d

4 files changed

Lines changed: 24 additions & 0 deletions

File tree

e2e-tests/tests/e2e.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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]

ldk-server-grpc/src/proto/types.proto

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,16 @@ 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 witness script that is used to lock the channel's funding output to commitment transactions.
573+
//
574+
// This field will be `None` if we have not negotiated the funding transaction with our
575+
// counterparty already.
576+
//
577+
// When a channel is spliced, this continues to refer to the original pre-splice channel
578+
// state until the splice transaction reaches sufficient confirmations to be locked (and we
579+
// exchange `splice_locked` messages with our peer).
580+
optional string funding_redeem_script = 34;
571581
}
572582

573583
// ChannelConfig represents the configuration settings for a channel in a Lightning Network node.

ldk-server-grpc/src/types.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,16 @@ 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 witness script that is used to lock the channel's funding output to commitment transactions.
683+
///
684+
/// This field will be `None` if we have not negotiated the funding transaction with our
685+
/// counterparty already.
686+
///
687+
/// When a channel is spliced, this continues to refer to the original pre-splice channel
688+
/// state until the splice transaction reaches sufficient confirmations to be locked (and we
689+
/// exchange `splice_locked` messages with our peer).
690+
#[prost(string, optional, tag = "34")]
691+
pub funding_redeem_script: ::core::option::Option<::prost::alloc::string::String>,
682692
}
683693
/// ChannelConfig represents the configuration settings for a channel in a Lightning Network node.
684694
/// See more: <https://docs.rs/lightning/latest/lightning/util/config/struct.ChannelConfig.html>

ldk-server/src/util/proto_adapter.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)