Skip to content

Commit 1e50427

Browse files
committed
Rename OpenChannelRequest::is_public to is_announced
Referring to announced/unannounced channels 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).
1 parent 680d399 commit 1e50427

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lightning/src/events/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,7 @@ pub enum Event {
13161316
/// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
13171317
channel_type: ChannelTypeFeatures,
13181318
/// True if this channel is (or will be) publicly-announced.
1319-
is_public: bool,
1319+
is_announced: bool,
13201320
/// Channel parameters given by the counterparty.
13211321
params: msgs::ChannelParameters,
13221322
},

lightning/src/ln/channelmanager.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7423,14 +7423,14 @@ where
74237423
MsgHandleErrInternal::from_chan_no_close(e, msg.common_fields.temporary_channel_id)
74247424
)?;
74257425
let mut pending_events = self.pending_events.lock().unwrap();
7426-
let is_public = (msg.common_fields.channel_flags & 1) == 1;
7426+
let is_announced = (msg.common_fields.channel_flags & 1) == 1;
74277427
pending_events.push_back((events::Event::OpenChannelRequest {
74287428
temporary_channel_id: msg.common_fields.temporary_channel_id.clone(),
74297429
counterparty_node_id: counterparty_node_id.clone(),
74307430
funding_satoshis: msg.common_fields.funding_satoshis,
74317431
push_msat: msg.push_msat,
74327432
channel_type,
7433-
is_public,
7433+
is_announced,
74347434
params: msg.common_fields.channel_parameters(),
74357435
}, None));
74367436
peer_state.inbound_channel_request_by_id.insert(channel_id, InboundChannelRequest {

0 commit comments

Comments
 (0)