Skip to content

Commit 77bf352

Browse files
committed
Add flags for if a channel is pub and funding txo in ChannelDetails
1 parent c60543c commit 77bf352

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,12 @@ pub struct ChannelDetails {
604604
/// Note that this means this value is *not* persistent - it can change once during the
605605
/// lifetime of the channel.
606606
pub channel_id: [u8; 32],
607+
/// The Channel's funding transaction output, if we've negotiated the funding transaction with
608+
/// our counterparty already.
609+
///
610+
/// Note that, if this has been set, `channel_id` will be equivalent to
611+
/// `funding_txo.unwrap().to_channel_id()`.
612+
pub funding_txo: Option<OutPoint>,
607613
/// The position of the funding transaction in the chain. None if the funding transaction has
608614
/// not yet been confirmed and the channel fully opened.
609615
pub short_channel_id: Option<u64>,
@@ -631,7 +637,8 @@ pub struct ChannelDetails {
631637
/// True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
632638
/// the peer is connected, and (c) no monitor update failure is pending resolution.
633639
pub is_live: bool,
634-
640+
/// True if this channel is (or will be) publicly-announced.
641+
pub is_public: bool,
635642
/// Information on the fees and requirements that the counterparty requires when forwarding
636643
/// payments to us through this channel.
637644
pub counterparty_forwarding_info: Option<CounterpartyForwardingInfo>,
@@ -954,6 +961,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
954961
let (inbound_capacity_msat, outbound_capacity_msat) = channel.get_inbound_outbound_available_balance_msat();
955962
res.push(ChannelDetails {
956963
channel_id: (*channel_id).clone(),
964+
funding_txo: channel.get_funding_txo(),
957965
short_channel_id: channel.get_short_channel_id(),
958966
remote_network_id: channel.get_counterparty_node_id(),
959967
counterparty_features: InitFeatures::empty(),
@@ -962,6 +970,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
962970
outbound_capacity_msat,
963971
user_id: channel.get_user_id(),
964972
is_live: channel.is_live(),
973+
is_public: channel.should_announce(),
965974
counterparty_forwarding_info: channel.counterparty_forwarding_info(),
966975
});
967976
}

0 commit comments

Comments
 (0)