@@ -1515,7 +1515,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
15151515 SP::Target: SignerProvider,
15161516 {
15171517 let logger = WithContext::from(logger, Some(counterparty_node_id), Some(open_channel_fields.temporary_channel_id), None);
1518- let announced_channel = if (open_channel_fields.channel_flags & 1) == 1 { true } else { false };
1518+ let announce_for_forwarding = if (open_channel_fields.channel_flags & 1) == 1 { true } else { false };
15191519
15201520 let channel_value_satoshis = our_funding_satoshis.saturating_add(open_channel_fields.funding_satoshis);
15211521
@@ -1589,7 +1589,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
15891589 // Convert things into internal flags and prep our state:
15901590
15911591 if config.channel_handshake_limits.force_announced_channel_preference {
1592- if config.channel_handshake_config.announced_channel != announced_channel {
1592+ if config.channel_handshake_config.announce_for_forwarding != announce_for_forwarding {
15931593 return Err(ChannelError::close("Peer tried to open channel but their announcement preference is different from ours".to_owned()));
15941594 }
15951595 }
@@ -1689,7 +1689,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
16891689
16901690 config: LegacyChannelConfig {
16911691 options: config.channel_config.clone(),
1692- announced_channel ,
1692+ announce_for_forwarding ,
16931693 commit_upfront_shutdown_pubkey: config.channel_handshake_config.commit_upfront_shutdown_pubkey,
16941694 },
16951695
@@ -1921,7 +1921,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
19211921
19221922 config: LegacyChannelConfig {
19231923 options: config.channel_config.clone(),
1924- announced_channel : config.channel_handshake_config.announced_channel ,
1924+ announce_for_forwarding : config.channel_handshake_config.announce_for_forwarding ,
19251925 commit_upfront_shutdown_pubkey: config.channel_handshake_config.commit_upfront_shutdown_pubkey,
19261926 },
19271927
@@ -2066,7 +2066,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
20662066 }
20672067
20682068 pub fn should_announce(&self) -> bool {
2069- self.config.announced_channel
2069+ self.config.announce_for_forwarding
20702070 }
20712071
20722072 pub fn is_outbound(&self) -> bool {
@@ -6920,7 +6920,7 @@ impl<SP: Deref> Channel<SP> where
69206920 fn get_channel_announcement<NS: Deref>(
69216921 &self, node_signer: &NS, chain_hash: ChainHash, user_config: &UserConfig,
69226922 ) -> Result<msgs::UnsignedChannelAnnouncement, ChannelError> where NS::Target: NodeSigner {
6923- if !self.context.config.announced_channel {
6923+ if !self.context.config.announce_for_forwarding {
69246924 return Err(ChannelError::Ignore("Channel is not available for public announcements".to_owned()));
69256925 }
69266926 if !self.context.is_usable() {
@@ -7778,7 +7778,7 @@ impl<SP: Deref> OutboundV1Channel<SP> where SP::Target: SignerProvider {
77787778 delayed_payment_basepoint: keys.delayed_payment_basepoint.to_public_key(),
77797779 htlc_basepoint: keys.htlc_basepoint.to_public_key(),
77807780 first_per_commitment_point,
7781- channel_flags: if self.context.config.announced_channel {1} else {0},
7781+ channel_flags: if self.context.config.announce_for_forwarding {1} else {0},
77827782 shutdown_scriptpubkey: Some(match &self.context.shutdown_scriptpubkey {
77837783 Some(script) => script.clone().into_inner(),
77847784 None => Builder::new().into_script(),
@@ -7943,8 +7943,8 @@ pub(super) fn channel_type_from_open_channel(
79437943 if channel_type.requires_unknown_bits_from(&our_supported_features) {
79447944 return Err(ChannelError::close("Channel Type contains unsupported features".to_owned()));
79457945 }
7946- let announced_channel = if (common_fields.channel_flags & 1) == 1 { true } else { false };
7947- if channel_type.requires_scid_privacy() && announced_channel {
7946+ let announce_for_forwarding = if (common_fields.channel_flags & 1) == 1 { true } else { false };
7947+ if channel_type.requires_scid_privacy() && announce_for_forwarding {
79487948 return Err(ChannelError::close("SCID Alias/Privacy Channel Type cannot be set on a public channel".to_owned()));
79497949 }
79507950 Ok(channel_type.clone())
@@ -8317,7 +8317,7 @@ impl<SP: Deref> OutboundV2Channel<SP> where SP::Target: SignerProvider {
83178317 delayed_payment_basepoint: keys.delayed_payment_basepoint.to_public_key(),
83188318 htlc_basepoint: keys.htlc_basepoint.to_public_key(),
83198319 first_per_commitment_point,
8320- channel_flags: if self.context.config.announced_channel {1} else {0},
8320+ channel_flags: if self.context.config.announce_for_forwarding {1} else {0},
83218321 shutdown_scriptpubkey: Some(match &self.context.shutdown_scriptpubkey {
83228322 Some(script) => script.clone().into_inner(),
83238323 None => Builder::new().into_script(),
@@ -8496,7 +8496,7 @@ fn get_initial_channel_type(config: &UserConfig, their_features: &InitFeatures)
84968496 // available. If it's private, we first try `scid_privacy` as it provides better privacy
84978497 // with no other changes, and fall back to `only_static_remotekey`.
84988498 let mut ret = ChannelTypeFeatures::only_static_remote_key();
8499- if !config.channel_handshake_config.announced_channel &&
8499+ if !config.channel_handshake_config.announce_for_forwarding &&
85008500 config.channel_handshake_config.negotiate_scid_privacy &&
85018501 their_features.supports_scid_privacy() {
85028502 ret.set_scid_privacy_required();
@@ -8968,7 +8968,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c Ch
89688968 // Read the old serialization of the ChannelConfig from version 0.0.98.
89698969 config.as_mut().unwrap().options.forwarding_fee_proportional_millionths = Readable::read(reader)?;
89708970 config.as_mut().unwrap().options.cltv_expiry_delta = Readable::read(reader)?;
8971- config.as_mut().unwrap().announced_channel = Readable::read(reader)?;
8971+ config.as_mut().unwrap().announce_for_forwarding = Readable::read(reader)?;
89728972 config.as_mut().unwrap().commit_upfront_shutdown_pubkey = Readable::read(reader)?;
89738973 } else {
89748974 // Read the 8 bytes of backwards-compatibility ChannelConfig data.
@@ -10287,7 +10287,7 @@ mod tests {
1028710287
1028810288 let counterparty_node_id = PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&[42; 32]).unwrap());
1028910289 let mut config = UserConfig::default();
10290- config.channel_handshake_config.announced_channel = false;
10290+ config.channel_handshake_config.announce_for_forwarding = false;
1029110291 let mut chan = OutboundV1Channel::<&Keys>::new(&LowerBoundedFeeEstimator::new(&feeest), &&keys_provider, &&keys_provider, counterparty_node_id, &channelmanager::provided_init_features(&config), 10_000_000, 0, 42, &config, 0, 42, None, &*logger).unwrap(); // Nothing uses their network key in this test
1029210292 chan.context.holder_dust_limit_satoshis = 546;
1029310293 chan.context.counterparty_selected_channel_reserve_satoshis = Some(0); // Filled in in accept_channel
0 commit comments