Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions e2e-tests/tests/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,9 @@ async fn test_cli_list_channels() {
// configured, so the reserve type is deterministically Adaptive.
assert_eq!(channel["reserve_type"].as_i64(), Some(ReserveType::Adaptive as i64));
assert!(!channel["channel_type"].as_object().unwrap().is_empty());

// A funded, usable channel has a real funding redeem script.
assert!(channel["funding_redeem_script"].as_str().is_some_and(|s| !s.is_empty()));
}

#[tokio::test]
Expand Down
10 changes: 10 additions & 0 deletions ldk-server-grpc/src/proto/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,16 @@ message Channel {
// The negotiated channel-type features, keyed by the signaled BOLT feature bit.
// This map is empty until channel negotiation determines the channel type.
map<uint32, Feature> channel_type = 33;

// The witness script that is used to lock the channel's funding output to commitment transactions.
//
// This field will be `None` if we have not negotiated the funding transaction with our
// counterparty already.
//
// When a channel is spliced, this continues to refer to the original pre-splice channel
// state until the splice transaction reaches sufficient confirmations to be locked (and we
// exchange `splice_locked` messages with our peer).
optional string funding_redeem_script = 34;
}

// ChannelConfig represents the configuration settings for a channel in a Lightning Network node.
Expand Down
10 changes: 10 additions & 0 deletions ldk-server-grpc/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,16 @@ pub struct Channel {
/// This map is empty until channel negotiation determines the channel type.
#[prost(btree_map = "uint32, message", tag = "33")]
pub channel_type: ::prost::alloc::collections::BTreeMap<u32, Feature>,
/// The witness script that is used to lock the channel's funding output to commitment transactions.
///
/// This field will be `None` if we have not negotiated the funding transaction with our
/// counterparty already.
///
/// When a channel is spliced, this continues to refer to the original pre-splice channel
/// state until the splice transaction reaches sufficient confirmations to be locked (and we
/// exchange `splice_locked` messages with our peer).
#[prost(string, optional, tag = "34")]
pub funding_redeem_script: ::core::option::Option<::prost::alloc::string::String>,
}
/// ChannelConfig represents the configuration settings for a channel in a Lightning Network node.
/// See more: <https://docs.rs/lightning/latest/lightning/util/config/struct.ChannelConfig.html>
Expand Down
1 change: 1 addition & 0 deletions ldk-server/src/util/proto_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ pub(crate) fn channel_to_proto(channel: ChannelDetails) -> Channel {
.map(|s| channel_shutdown_state_to_proto(s) as i32),
reserve_type: channel.reserve_type.as_ref().map(|r| reserve_type_to_proto(r) as i32),
channel_type,
funding_redeem_script: channel.funding_redeem_script.map(|script| script.to_hex_string()),
}
}

Expand Down