]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Rename `OpenChannelRequest::is_public` to `is_announced`
authorElias Rohrer <dev@tnull.de>
Tue, 20 Aug 2024 11:43:40 +0000 (13:43 +0200)
committerElias Rohrer <dev@tnull.de>
Wed, 21 Aug 2024 10:38:27 +0000 (12:38 +0200)
Referring to announced/unannounced channels as 'public'/'private'
regularly leads to confusion on what they are and when which should be
used. To avoid perpetuating this confusion, we should avoid referring to
announced channels as 'public' in our API.

Here we rename the recently introduced field in `OpenChannelRequest`
(which doesn't break released API), and will align the pre-existing
instances of `is_public` in the following commit (which will break API).

lightning/src/events/mod.rs
lightning/src/ln/channelmanager.rs

index d756eff1bad30e63bc41a4301e9ac1ee08d46420..bee7e85c822b1f5f45d4589fa9d731d114a399cf 100644 (file)
@@ -1316,7 +1316,7 @@ pub enum Event {
                /// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
                channel_type: ChannelTypeFeatures,
                /// True if this channel is (or will be) publicly-announced.
-               is_public: bool,
+               is_announced: bool,
                /// Channel parameters given by the counterparty.
                params: msgs::ChannelParameters,
        },
index 167ab0ac8fd8a16475abc99890939df39e372e6f..49f7a38ece7715ddc916b04999428f579af44485 100644 (file)
@@ -7423,14 +7423,14 @@ where
                                        MsgHandleErrInternal::from_chan_no_close(e, msg.common_fields.temporary_channel_id)
                                )?;
                        let mut pending_events = self.pending_events.lock().unwrap();
-                       let is_public = (msg.common_fields.channel_flags & 1) == 1;
+                       let is_announced = (msg.common_fields.channel_flags & 1) == 1;
                        pending_events.push_back((events::Event::OpenChannelRequest {
                                temporary_channel_id: msg.common_fields.temporary_channel_id.clone(),
                                counterparty_node_id: counterparty_node_id.clone(),
                                funding_satoshis: msg.common_fields.funding_satoshis,
                                push_msat: msg.push_msat,
                                channel_type,
-                               is_public,
+                               is_announced,
                                params: msg.common_fields.channel_parameters(),
                        }, None));
                        peer_state.inbound_channel_request_by_id.insert(channel_id, InboundChannelRequest {