@@ -1523,7 +1523,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
15231523 SP::Target: SignerProvider,
15241524 {
15251525 let logger = WithContext::from(logger, Some(counterparty_node_id), Some(open_channel_fields.temporary_channel_id), None);
1526- let announced_channel = if (open_channel_fields.channel_flags & 1) == 1 { true } else { false };
1526+ let announce_for_forwarding = if (open_channel_fields.channel_flags & 1) == 1 { true } else { false };
15271527
15281528 let channel_value_satoshis = our_funding_satoshis.saturating_add(open_channel_fields.funding_satoshis);
15291529
@@ -1597,7 +1597,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
15971597 // Convert things into internal flags and prep our state:
15981598
15991599 if config.channel_handshake_limits.force_announced_channel_preference {
1600- if config.channel_handshake_config.announced_channel != announced_channel {
1600+ if config.channel_handshake_config.announce_for_forwarding != announce_for_forwarding {
16011601 return Err(ChannelError::close("Peer tried to open channel but their announcement preference is different from ours".to_owned()));
16021602 }
16031603 }
@@ -1697,7 +1697,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
16971697
16981698 config: LegacyChannelConfig {
16991699 options: config.channel_config.clone(),
1700- announced_channel ,
1700+ announce_for_forwarding ,
17011701 commit_upfront_shutdown_pubkey: config.channel_handshake_config.commit_upfront_shutdown_pubkey,
17021702 },
17031703
@@ -1931,7 +1931,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
19311931
19321932 config: LegacyChannelConfig {
19331933 options: config.channel_config.clone(),
1934- announced_channel : config.channel_handshake_config.announced_channel ,
1934+ announce_for_forwarding : config.channel_handshake_config.announce_for_forwarding ,
19351935 commit_upfront_shutdown_pubkey: config.channel_handshake_config.commit_upfront_shutdown_pubkey,
19361936 },
19371937
@@ -2078,7 +2078,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
20782078 }
20792079
20802080 pub fn should_announce(&self) -> bool {
2081- self.config.announced_channel
2081+ self.config.announce_for_forwarding
20822082 }
20832083
20842084 pub fn is_outbound(&self) -> bool {
@@ -6969,7 +6969,7 @@ impl<SP: Deref> Channel<SP> where
69696969 fn get_channel_announcement<NS: Deref>(
69706970 &self, node_signer: &NS, chain_hash: ChainHash, user_config: &UserConfig,
69716971 ) -> Result<msgs::UnsignedChannelAnnouncement, ChannelError> where NS::Target: NodeSigner {
6972- if !self.context.config.announced_channel {
6972+ if !self.context.config.announce_for_forwarding {
69736973 return Err(ChannelError::Ignore("Channel is not available for public announcements".to_owned()));
69746974 }
69756975 if !self.context.is_usable() {
@@ -7827,7 +7827,7 @@ impl<SP: Deref> OutboundV1Channel<SP> where SP::Target: SignerProvider {
78277827 delayed_payment_basepoint: keys.delayed_payment_basepoint.to_public_key(),
78287828 htlc_basepoint: keys.htlc_basepoint.to_public_key(),
78297829 first_per_commitment_point,
7830- channel_flags: if self.context.config.announced_channel {1} else {0},
7830+ channel_flags: if self.context.config.announce_for_forwarding {1} else {0},
78317831 shutdown_scriptpubkey: Some(match &self.context.shutdown_scriptpubkey {
78327832 Some(script) => script.clone().into_inner(),
78337833 None => Builder::new().into_script(),
@@ -7992,8 +7992,8 @@ pub(super) fn channel_type_from_open_channel(
79927992 if channel_type.requires_unknown_bits_from(&our_supported_features) {
79937993 return Err(ChannelError::close("Channel Type contains unsupported features".to_owned()));
79947994 }
7995- let announced_channel = if (common_fields.channel_flags & 1) == 1 { true } else { false };
7996- if channel_type.requires_scid_privacy() && announced_channel {
7995+ let announce_for_forwarding = if (common_fields.channel_flags & 1) == 1 { true } else { false };
7996+ if channel_type.requires_scid_privacy() && announce_for_forwarding {
79977997 return Err(ChannelError::close("SCID Alias/Privacy Channel Type cannot be set on a public channel".to_owned()));
79987998 }
79997999 Ok(channel_type.clone())
@@ -8366,7 +8366,7 @@ impl<SP: Deref> OutboundV2Channel<SP> where SP::Target: SignerProvider {
83668366 delayed_payment_basepoint: keys.delayed_payment_basepoint.to_public_key(),
83678367 htlc_basepoint: keys.htlc_basepoint.to_public_key(),
83688368 first_per_commitment_point,
8369- channel_flags: if self.context.config.announced_channel {1} else {0},
8369+ channel_flags: if self.context.config.announce_for_forwarding {1} else {0},
83708370 shutdown_scriptpubkey: Some(match &self.context.shutdown_scriptpubkey {
83718371 Some(script) => script.clone().into_inner(),
83728372 None => Builder::new().into_script(),
@@ -8545,7 +8545,7 @@ fn get_initial_channel_type(config: &UserConfig, their_features: &InitFeatures)
85458545 // available. If it's private, we first try `scid_privacy` as it provides better privacy
85468546 // with no other changes, and fall back to `only_static_remotekey`.
85478547 let mut ret = ChannelTypeFeatures::only_static_remote_key();
8548- if !config.channel_handshake_config.announced_channel &&
8548+ if !config.channel_handshake_config.announce_for_forwarding &&
85498549 config.channel_handshake_config.negotiate_scid_privacy &&
85508550 their_features.supports_scid_privacy() {
85518551 ret.set_scid_privacy_required();
@@ -9017,7 +9017,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c Ch
90179017 // Read the old serialization of the ChannelConfig from version 0.0.98.
90189018 config.as_mut().unwrap().options.forwarding_fee_proportional_millionths = Readable::read(reader)?;
90199019 config.as_mut().unwrap().options.cltv_expiry_delta = Readable::read(reader)?;
9020- config.as_mut().unwrap().announced_channel = Readable::read(reader)?;
9020+ config.as_mut().unwrap().announce_for_forwarding = Readable::read(reader)?;
90219021 config.as_mut().unwrap().commit_upfront_shutdown_pubkey = Readable::read(reader)?;
90229022 } else {
90239023 // Read the 8 bytes of backwards-compatibility ChannelConfig data.
@@ -10338,7 +10338,7 @@ mod tests {
1033810338
1033910339 let counterparty_node_id = PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&[42; 32]).unwrap());
1034010340 let mut config = UserConfig::default();
10341- config.channel_handshake_config.announced_channel = false;
10341+ config.channel_handshake_config.announce_for_forwarding = false;
1034210342 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
1034310343 chan.context.holder_dust_limit_satoshis = 546;
1034410344 chan.context.counterparty_selected_channel_reserve_satoshis = Some(0); // Filled in in accept_channel
0 commit comments